Python client for the Festival API — film festival data for developers
Project description
Festival API — Python Client
Client library for the Festival API.
pip install festivalapi
Usage
from festivalapi import FestivalAPI
client = FestivalAPI("fes_your_api_key")
# Search festivals by category
festivals = client.festivals.list(category="short_film")
# Keyword search
results = client.festivals.list(q="Cambodia")
# Get festival detail
festival = client.festivals.get(1)
# Get festival roster (past winners / screened films)
roster = client.festivals.roster(1)
# Get scored festivals
scored = client.festivals.scored(min_score=70)
# List available category codes (requires auth)
categories = client.categories()
for cat in categories["results"]:
print(f'{cat["category"]} ({cat["count"]})')
# Health check (no auth)
client.health()
Categories
Call client.categories() to get all available category codes. Returns:
{
"count": 158,
"results": [
{"category": "short_film", "count": 60},
{"category": "feature", "count": 55},
{"category": "documentary", "count": 31},
{"category": "animation", "count": 14},
{"category": "horror", "count": 12},
{"category": "experimental", "count": 10},
{"category": "ai", "count": 10},
{"category": "music_video", "count": 14},
{"category": "web_series", "count": 9},
{"category": "comedy", "count": 5},
{"category": "sci_fi", "count": 5},
{"category": "student", "count": 5},
{"category": "lgbtq", "count": 3},
{"category": "vr_360", "count": 2},
...
]
}
Common filters: short_film, feature, documentary, animation, horror, sci_fi, comedy, experimental, music_video, ai, web_series, student, lgbtq, vr_360.
Use the category field (lowercase) as the filter value — e.g. client.festivals.list(category="horror").
API Key
Sign up at festivalapi.com to get your API key (starts with fes_). You can also set the FESTIVALAPI_KEY environment variable.
Error Handling
from festivalapi import FestivalAPI, NotFoundError, InsufficientCreditsError
client = FestivalAPI("fes_your_api_key")
try:
festival = client.festivals.get(999999)
except NotFoundError:
print("Festival not found")
except InsufficientCreditsError as e:
print(f"Need more credits: {e}")
Requirements
- Python 3.9+
- Zero dependencies (uses only stdlib
urllib)
License
MIT
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
festivalapi-0.2.3.tar.gz
(4.5 kB
view details)
File details
Details for the file festivalapi-0.2.3.tar.gz.
File metadata
- Download URL: festivalapi-0.2.3.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
807160fa7664661c736ee4eb84337ac7203f0e39bd0a225aec138628c9108bf4
|
|
| MD5 |
34992cb0cf104e8e16eecbbb9ded6947
|
|
| BLAKE2b-256 |
4a249b7b9aa53c61e0b7618391e091ea47b3c3d0657d4058f5e425739779e8f6
|