Skip to main content

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.

Metadata

Release files for ticketscloud 0.6.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ticketscloud 0.6.4
File Size Uploaded
ticketscloud-0.6.4.tar.gz 6.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ticketscloud 0.6.4
File Interpreter ABI Platform
ticketscloud-0.6.4-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 13.7 kB

Release files / ticketscloud-0.6.4.tar.gz

Download URL ticketscloud-0.6.4.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f179e40443d49f5b10660f50328f16ebeb367605b9e39ee38a175767e0f0f7b6
BLAKE2b-256 checksum
How to use checksums
5f67a8bf37d13c973737c690276e466e0f993b74e8b0b0707306fdeb1ede43ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / ticketscloud-0.6.4-py2.py3-none-any.whl

Download URL ticketscloud-0.6.4-py2.py3-none-any.whl
Size 7.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
e3a11658abfbadcd190f5de0f8ddce2f4d259b340f653ef43bc9c964afe0617f
BLAKE2b-256 checksum
How to use checksums
eb9017c3d6caba1ad734b77617ec82e0ae980f11bce90c61e5a2ed8f0a4f37c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.6.4 This release

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page