Python library and tool for creating events in the pretix ticketing system.
This program enables cloning and automatic customization of events in the pretix ticketing system. It was developed to quickly create recurring events (e.g., workshops) by using an existing event as a template.
- Python 3.7 or higher
- A pretix account with API token
- Organizer permissions in pretix
-
Clone or download the repository
-
Create a virtual environment (recommended but not necessary)
python3 -m venv venv source venv/bin/activate -
Install dependencies:
pip install -r requirements.txt
-
Configure environment variables:
Create a
.envfile in the main directory with the following content:API_TOKEN=your_pretix_api_token ORGANIZER=your_organizer_slugAPI_TOKEN: Your personal API token from pretix (found under: teams → klick on a team → under API-Tokens → add)ORGANIZER: The slug of your organizer (e.g., "dojosw")
There are two ways to start the program:
Option 1: Using the run.sh script
./run.sh rOption 2: Directly with Python
PYTHONPATH=pretix-python ./tests/main.py-
Select Event Template:
- The program displays the 10 most recent events
- Use arrow keys to select the event that should serve as a template
- Confirm with Enter
-
Enter New Event Data:
- Event Name: Enter the name for the new event (or press Enter to keep the same name)
- Date: Choose the date for the new event (suggestion: next Saturday)
- Time: Enter the start time (in HH:MM format)
- Duration: Enter the duration in hours
-
Select Description:
- The program shows all available description templates
- These are located in the
descriptions/folder - Choose the appropriate description for your event
-
Done:
- The new event is created and automatically configured
- For events with latecomer tickets, availability is automatically set to the Wednesday before the event
Descriptions are managed in the descriptions/ folder. Each template has its own subfolder with language files:
descriptions/
my_workshop/
de-informal.txt # German versionc
en.txt # English version
To add a new description:
- Create a new folder under
descriptions/ - Create the desired language files (e.g.,
de-informal.txt,en.txt) - Add the description text to the files
For testing and development, you can start an interactive Python shell with preloaded modules:
./run.sh tThis starts ipython with the correct PYTHONPATH.