Skip to main content

UNKNOWN

Project description

Ticketscloud API Client – A python client for API ticketscloud.ru

Build Status https://pypip.in/d/ticketscloud/badge.png https://badge.fury.io/py/ticketscloud.png

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ticketscloud-0.6.3.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

ticketscloud-0.6.3-py2.py3-none-any.whl (7.3 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file ticketscloud-0.6.3.tar.gz.

File metadata

File hashes

Hashes for ticketscloud-0.6.3.tar.gz
Algorithm Hash digest
SHA256 0b3d46ba0fb89f3f44ba98b7c0ff7bb15822ba9929dbae6b4975cd1c8c853a91
MD5 d6bc3970dc1d1d37b4803e757e710054
BLAKE2b-256 595c8b0d1b45275f5701586be522610c32d721e5a1ffa4b7acbf3b54ac84152f

See more details on using hashes here.

File details

Details for the file ticketscloud-0.6.3-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for ticketscloud-0.6.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 9ad9e215035a701297a5596e89cf52540bef6fff9ad5dcf8dcec8a2db56da3fa
MD5 8c2d32fba3249689b94c8a58c34c8381
BLAKE2b-256 a8cc478d89ed9264e82fefb3f1c01488162d059d7942ac5bc843d323b2bbbe9b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page