Metadata-Version: 2.1
Name: wcfmclient
Version: 1.0.0
Summary: UNKNOWN
Home-page: UNKNOWN
Author: palanskiheji
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.6
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=2.7,!=3.0.*,!=3.1.*
Description-Content-Type: text/markdown
Requires-Dist: requests

## WCFM ReST API Client

### Installation
This library is distributed on `pypi`. In order to add it as a dependency, run the following command:

``` sh
$ pip install wcfmclient
```
or

``` sh
$ pip3 install wcfmclient
```

### Prerequisite
This library is built in consideration with [JWT Authentication for WP REST API](https://wordpress.org/plugins/jwt-authentication-for-wp-rest-api/).
Make sure that you follow WCFM's official authentication setup [here](https://docs.wclovers.com/wcfm-app/).

### Using the client library
Instantiate an API object as shown below
``` python
    from wcfmclient.api import API
    from wcfmclient.jwt_auth_service import JWTAuthService
    from wcfmclient.session import session

    api = API(**{
        "username": "vendor's username",
        "password": "vendor's password",
        "url": "https://your.domain.name",
        "session": session
    })
```

Authenticate with your store's server.

``` python
    from wcfmclient.api import API
    from wcfmclient.jwt_auth_service import JWTAuthService
    from wcfmclient.session import session

    api = API(**{
        "username": "vendor's username",
        "password": "vendor's password",
        "url": "https://your.domain.name",
        "session": session
    })

    jwt_auth_service = JWTAuthService(api)
    jwt_auth_service.authenticate()
```

Consuming wcfm rest api.

``` python
    from wcfmclient.api import API
    from wcfmclient.jwt_auth_service import JWTAuthService
    from wcfmclient.session import session

    api = API(**{
        "username": "vendor's username",
        "password": "vendor's password",
        "url": "https://your.domain.name",
        "session": session
    })

    jwt_auth_service = JWTAuthService(api)
    jwt_auth_service.authenticate()

    res = api.get("wp-json/wcfmmp/v1/products/")
    products = res.json()
```


