Asynchronous Python wrapper for WooCommerce REST API
Project description
Asynchronous Python wrapper for WooCommerce REST API.
Gives you asynchronous access to the REST API. Based on aiohttp and wc-api-python.
PRs are highly appreciated!
Installation
pip install aiowc or pip install "git+https://github.com/vakochetkov/aiowc"
Getting started
Import aiowc:
from aiowc import API, APISession
Set API parameters:
wcapi = API(
url="https://example.com",
consumer_key="ck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
consumer_secret="cs_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
version="wc/v3",
timeout=30
)
Make request with aiohttp session:
async def main():
async with APISession(wcapi) as session:
res = await session.get('products/categories', params={'per_page': 5})
json = await res.json()
print(json)
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
Options and request types:
Fully compatible with wc-api-python
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
aiowc-0.2.4.tar.gz
(6.1 kB
view hashes)
Built Distribution
aiowc-0.2.4-py3-none-any.whl
(6.6 kB
view hashes)