This library provides easy access to Entase API for Python language.
Python 3.7 or later with the following packages:
requests- For HTTP communication
pip install entase-sdkClone this repository and install using setup.py:
git clone https://github.com/entaseteam/sdk.python.git
cd sdk.python
pip install .Initialize the Client with your secret key and you're ready to go:
from entase import Client
# Initialize client
entase = Client('your_secret_key')
# Get upcoming events
upcoming = entase.events.get_all({
'limit': 10,
'filter': {
'status': 1
}
})
# Process results
for event in upcoming:
print(event.get('dateStart'))Responses from the API come in two forms - single object or object collection. The object collection interface has an iterable cursor with built-in features for paging the requests.
Example of handling pagination:
# Get all events (limited to 100 per request)
events = entase.events.get_all({'limit': 100})
# Get events in batches of 100 from the API
while events.has_more():
# Loop through current result set
for event in events:
# Process event...
passThe has_more() method will automatically fetch additional batches from the API. Use it with caution to avoid excessive API requests.
You can also access the events collection manually via events.data.
To handle pagination manually, use the after filter to provide the last object ID from your previous result set:
# Get events after a specific ID
events = entase.events.get_all({
'limit': 100,
'after': '6002d051ce1b73294c3aeacc'
})The client will raise exceptions for API errors. Use try/except blocks for smooth error handling:
from entase.exceptions import BaseError
try:
productions = entase.productions.get_all({'limit': 10})
except BaseError as e:
print(f"Error: {e}")entase.productions.get_all(data=None)- Get all productionsentase.productions.get_by_id(id_)- Get production by ID
entase.events.get_all(data=None)- Get all eventsentase.events.get_by_id(id_)- Get event by ID
entase.booking_orders.get_by_id(id_)- Get order by IDentase.booking_orders.get_by_code(code)- Get order by codeentase.booking_orders.get_all_tickets_by_order(order_id_or_code)- Get all tickets for an orderentase.booking_orders.get_ticket_by_order(order_id_or_code, ticket_id_or_code)- Get specific ticket
entase.partners.get_by_id(id_)- Get partner by IDentase.partners.me()- Get current partner info
entase.photos.get_by_object(objref, data=None)- Get photos by object reference
