Metadata-Version: 2.1
Name: aiowc
Version: 0.2.4
Summary: Asynchronous Python wrapper for WooCommerce REST API
Home-page: https://github.com/vakochetkov/aiowc
Author: Vladislav Kochetkov
Author-email: Vladislav Kochetkov <vakochetkov@gmail.com>
License: MIT License
Project-URL: Homepage, https://github.com/vakochetkov/aiowc
Project-URL: Issues, https://github.com/vakochetkov/aiowc/issues
Keywords: python,woocommerce,rest,api,async,asyncio,aiohttp,wcapi
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/x-rst
License-File: LICENSE
Requires-Dist: aiohttp >=3.9.3

..................................
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>`_ 
