$ python setup.py install$ goodscloud_api_clientA Python REPL starts up:
# Instantiate with API host, username, and password:
>>> gc = GoodsCloudAPIClient(host="http://app.goodscloud.com", user="test@example.com", pwd="testpass")
# Then, do requests as follows:
>>> orders = gc.get(
>>> "/api/internal/order",
>>> q=dict(filters=[dict(name="channel_id", op="eq", val=16)]), results_per_page=20, page=1)
200 OK
>>> first_id = orders.json()['objects'][0]['id']
>>> gc.patch(url="/api/internal/order/{}".format(first_id),
>>> dict(pay_later=True)
200 OK
>>> gc.delete(url="/api/internal/order/{}".format(first_id))
204 NO CONTENTThe files in the examples/ folder and the GoodsCloud API docs <http://docs.goodscloud.net/> provide all required information to start writing scripts.
To run a script:
$ python <path/to/your/script.py> # your command line arguments go hereTo view logger output on STDOUT, do this:
>>> import logging
>>> logging.getLogger('goodscloud_api_client').addHandler(logging.StreamHandler())Instantiating a GoodsCloudAPIClient with debug=True provides detailed output of the request signing and authentication process.