UNKNOWN
Project description
Ticketscloud API Client – A python client for API ticketscloud.ru
Docs are available at https://ticketscloud.readthedocs.org/. Pull requests with documentation enhancements and/or fixes are awesome and most welcome.
Requirements
python >= 2.6
Installation
Ticketscloud API Client could be installed using pip:
pip install ticketscloud
Usage
Initialize API client
You should have api_token, from the TC service.
from ticketscloud import TCClient client = TCClient(api_token='your-token-here')
Customize options
client = TCClient( access_token='your-token-here', api_root='http://ticketscloud.ru', api_version='v1', loglevel='info', user_agent='TC-Client', )
Working with TC API
The client has nice and easy syntax. Just have a look:
# Get events list GET http://ticketscloud.ru/v1/resources/events client.api.resources.events() client.api.resources.events['event-id']() # Get deals list with scheme GET http://ticketscloud.ru/v1/resources/deals client.api.resources.deals(**{ 'fields-schema': 'id,event{id},term{extra}', 'status': 'accepted'}) # Create a new order POST http://ticketscloud.ru/v1/resources/orders/ client.api.resources.orders.post(total=..., event=...) # Update a order PATCH http://ticketscloud.ru/v1/resources/orders/<id> client.api.resources.orders['id'].patch(status=) # You could also use a 'getitem' syntax for resources client.api.resources['custom-resource-name'](**params) # Same there client.api['resources']['custom-resource-name'](**params) # And etc. I hope you make decision how the client works :)
Context manager
You could temporary redefine the client settings in context:
with client.ctx(loglevel='DEBUG'): # More logging here client.api.resources.deals(**params)
Raw api request
You could make a raw request to TC API:
client.request(method='GET', url='v1/resources/events', data={...})
Have a nice codding!
Bug tracker
If you have any suggestions, bug reports or annoyances please report them to the issue tracker at https://github.com/Dipsomaniac/ticketscloud/issues
Contributing
Development of starter happens at github: https://github.com/Dipsomaniac/ticketscloud
Contributors
klen (Kirill Klenov)
License
Licensed under a BSD license.
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
Built Distribution
File details
Details for the file ticketscloud-0.2.0.tar.gz
.
File metadata
- Download URL: ticketscloud-0.2.0.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e22b1a88690ea923cc83aabedc55b20f1907993648118df058601de666b8f7b |
|
MD5 | 94503fcbc92fb8e41b220bd37f88ed08 |
|
BLAKE2b-256 | 03d40094318ac79cc007a4185702c2b9b06daef633552e2262381af3ccbd5318 |
File details
Details for the file ticketscloud-0.2.0-py2.py3-none-any.whl
.
File metadata
- Download URL: ticketscloud-0.2.0-py2.py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2547c07392b0b38fbac41239ab25abee7a6e445f9d46577f008f8cf549d46dac |
|
MD5 | e38931de12b33ebd45bd784d41b2227e |
|
BLAKE2b-256 | 93a28d5c6f1b10062a55e824e425b433ff9de86fe8dda178415bdd7446547dd0 |