A Pretix event person forwarder functionality
Project description
Pretix Event Person Forwarder
The Pretix Event Person Forwarder is a Python library that enables programmatic forwarding of event, order, and question data from Pretix to external systems via HTTP. Forward attendee registrations, order updates, and survey responses to webhooks, CRM systems, custom APIs or other Pretix systems.
Requirements
- Python 3.8 or later
- Running Pretix instance with HTTPS enabled
- Valid Pretix API token for authentication
Installation
Install the package via pip:
pip install pretix-event-person-forwarder
Optional: Enable HTTP/2 support:
pip install pretix-event-person-forwarder[http2]
Quick Start
Get started in under a minute:
from pretix_event_person_forwarder import Forwarder
forwarder = Forwarder(
api_url="https://your-pretix-instance.com/api/",
api_token="your-api-token"
)
For detailed usage and advanced configuration, see the documentation.
Core Features
The library provides several key components:
- Forwarder — Main orchestration class that manages event, order, and question forwarding from Pretix to external systems
- Orders — Forward order creation, modification, and payment status changes
- Events — Forward event data and updates to your endpoints
- Questions — Forward survey question responses and collected data
- Models — Strongly-typed data models for all request and response payloads
Configuration & Authentication
API Token
To authenticate, you need a valid Pretix API token:
- Log in to your Pretix admin panel
- Navigate to Settings → API → API tokens
- Create a new token or use an existing one with appropriate permissions
- Pass the token to Forwarder:
api_token="your-token-here"
URL Format
The API URL must include the /api/ path:
# Correct ✓
api_url = "https://your-pretix-instance.com/api/"
# Incorrect ✗
api_url = "https://your-pretix-instance.com"
Connection Options
Customize connection behavior via Forwarder constructor parameters:
timeout— Request timeout in seconds (default: 30)http2— Enable HTTP/2 support (requires http2 extra dependency)connection_pool_size— Simultaneous connections (default: 10)retries— Number of automatic retries on transient failures (default: 3)follow_redirects— Follow HTTP redirects (default: True)
Integration Tests
Integration tests require a running Pretix instance with HTTPS. The easiest way to set one up locally is via pretix-docker-compose, checked out as a sibling directory (../pretix-docker-compose).
Quick Setup
Run the setup script to generate certificates, start Docker, and create test data:
chmod +x scripts/setup-integration-tests.sh
./scripts/setup-integration-tests.sh
The script prints the exact export commands to run before executing the tests.
Environment Variables
| Variable | Description | Default |
|---|---|---|
PRETIX_HOST |
URL of the Pretix API | https://localhost |
PRETIX_TOKEN |
API token for the test user | required |
PRETIX_CA_BUNDLE |
Path to test CA certificate | SSL verification skipped if unset |
Troubleshooting
SSL: CERTIFICATE_VERIFY_FAILED — Verify PRETIX_CA_BUNDLE is exported, points to an absolute path, and the file is readable.
Connection Refused — Check that containers are running (docker compose ps) and port 443 is available. Inspect logs with docker compose logs -f pretix_app.
Organizer not found — Rerun the setup script or manually execute docker exec -i pretix_app pretix shell < tests/integrationtest/setup_testdata.py and check for errors.
Subject Alternative Name does not match — Regenerate certificates. Verify SANs with:
openssl x509 -in ../pretix-docker-compose/docker/pretix/files/config/ssl/domain.crt \
-text -noout | grep -A1 "Subject Alternative Name"
Cleanup
cd ../pretix-docker-compose
docker compose down # stop containers
docker compose down -v # stop and remove volumes
Development
Setup
This project uses uv for dependency management. To set up a development environment:
# Install uv if not already installed
pip install uv
# Create virtual environment and install dependencies
uv sync --all-extras
Running Tests
Unit Tests:
pytest tests/unittests
Coverage must be 80% or higher.
Integration Tests:
See the Integration Tests section above for setup instructions. Once configured:
pytest tests/integrationtest
Building Documentation
Documentation is built with mkdocs and mkdocs-material:
# Install docs dependencies
uv sync --extra docs
# Serve locally at http://localhost:8000
mkdocs serve
# Build static site
mkdocs build
Code Quality
Code is linted with Ruff:
ruff check src tests
ruff format src tests
To automatically fix issues:
ruff check --fix src tests
ruff format src tests
Contributing
If you would like to contribute something, have an improvement request, or want to make a change inside the code, please open a pull request.
Support
If you need support, or you encounter a bug, please don't hesitate to open an issue.
Donations
If you want to support my work, I ask you to take an unusual action inside the open source community. Donate the money to a non-profit organization like Doctors Without Borders or the Children's Cancer Aid. I will continue to build tools because I like them, and I am passionate about developing and sharing applications.
License
This product is available under the Apache 2.0 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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pretix_event_person_forwarder-1.0.2.tar.gz.
File metadata
- Download URL: pretix_event_person_forwarder-1.0.2.tar.gz
- Upload date:
- Size: 137.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b3e9468316dd567786211dd35ec071838b01011f620331627204b1d90fb0873a
|
|
| MD5 |
4eae9f99b4f8b8e47cfa59cbddcd421b
|
|
| BLAKE2b-256 |
accc33333439051f2681ed8672ef5e6de4ffde023e107612e1d7441f1a27eb76
|
Provenance
The following attestation bundles were made for pretix_event_person_forwarder-1.0.2.tar.gz:
Publisher:
release.yml on ZPascal/pretix-event-person-forwarder
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pretix_event_person_forwarder-1.0.2.tar.gz -
Subject digest:
b3e9468316dd567786211dd35ec071838b01011f620331627204b1d90fb0873a - Sigstore transparency entry: 2200588022
- Sigstore integration time:
-
Permalink:
ZPascal/pretix-event-person-forwarder@75a49c16b47c8cac9d9951c0d86d906916e67390 -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/ZPascal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@75a49c16b47c8cac9d9951c0d86d906916e67390 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pretix_event_person_forwarder-1.0.2-py3-none-any.whl.
File metadata
- Download URL: pretix_event_person_forwarder-1.0.2-py3-none-any.whl
- Upload date:
- Size: 16.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c9a83367baaef7f62e970a005d3dca1c6831515973bda6e0b8e54502937c1af
|
|
| MD5 |
2783e214b0d57ad2df1ab65b2ee8209a
|
|
| BLAKE2b-256 |
0bd84dc3f718b86f4dc603a962252f2ef88ae387ab76ccc9d356a5dfda35dae1
|
Provenance
The following attestation bundles were made for pretix_event_person_forwarder-1.0.2-py3-none-any.whl:
Publisher:
release.yml on ZPascal/pretix-event-person-forwarder
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pretix_event_person_forwarder-1.0.2-py3-none-any.whl -
Subject digest:
8c9a83367baaef7f62e970a005d3dca1c6831515973bda6e0b8e54502937c1af - Sigstore transparency entry: 2200588077
- Sigstore integration time:
-
Permalink:
ZPascal/pretix-event-person-forwarder@75a49c16b47c8cac9d9951c0d86d906916e67390 -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/ZPascal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@75a49c16b47c8cac9d9951c0d86d906916e67390 -
Trigger Event:
push
-
Statement type: