aiowc-0.2.3
توضیحات
Asynchronous Python wrapper for WooCommerce REST API
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | aiowc-0.2.3 |
| نام | aiowc |
| نسخه کتابخانه | 0.2.3 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Vladislav Kochetkov |
| ایمیل نویسنده | vakochetkov@gmail.com |
| آدرس صفحه اصلی | https://github.com/vakochetkov/aiowc |
| آدرس اینترنتی | https://pypi.org/project/aiowc/ |
| مجوز | - |
..................................
aiowc - Asynchronous Python Client
..................................
Asynchronous Python wrapper for WooCommerce REST API.
Gives you asynchronous access to the REST API.
Based on `aiohttp <https://github.com/aio-libs/aiohttp>`_ and `wc-api-python <https://github.com/woocommerce/wc-api-python>`_.
**PRs are highly appreciated!**
Installation
~~~~~~~~~~~~
``pip install aiowc`` or ``pip install "git+https://github.com/vakochetkov/aiowc"``
Getting started
~~~~~~~~~~~~~~~
* `Generate API credentials <http://woocommerce.github.io/woocommerce-rest-api-docs/#rest-api-keys>`_
* Import aiowc:
.. code-block:: python
from aiowc import API, APISession
* Set API parameters:
.. code-block:: python
wcapi = API(
url="https://example.com",
consumer_key="ck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
consumer_secret="cs_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
version="wc/v3",
timeout=30
)
* Make request with aiohttp session:
.. code-block:: python
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 <https://github.com/woocommerce/wc-api-python>`_
نیازمندی
| مقدار | نام |
|---|---|
| ~=3.7.4.post0 | aiohttp |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.7 | Python |
نحوه نصب
نصب پکیج whl aiowc-0.2.3:
pip install aiowc-0.2.3.whl
نصب پکیج tar.gz aiowc-0.2.3:
pip install aiowc-0.2.3.tar.gz