◐ Shell
reader mode source ↗
Skip to content
Open
Show file tree
Changes from all commits
File filter
Conversations
Jump to
Diff view
Apply and reload
Show whitespace
Diff view
Apply and reload
17 changes: 9 additions & 8 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ on:
branches:
- ep2024
- ep2025
schedule:
- cron: "*/10 * * * *" # every 10 minutes
workflow_dispatch:

jobs:
tests:
name: Run tests
runs-on: ubuntu-latest
timeout-minutes: 10

Expand All @@ -22,21 +23,21 @@ jobs:
- name: Set up Python 3
uses: actions/setup-python@v6
with:
python-version: '3.13'

- name: Setup uv
uses: astral-sh/setup-uv@v7

- name: Install dependencies from uv.lock
run: make deps/install

- name: Download data
run: uv run make download > /dev/null 2>&1
env:
PRETALX_TOKEN: ${{ secrets.PRETALX_TOKEN }}

- name: Transform data
run: uv run make transform > /dev/null 2>&1

- name: Setup SSH
uses: webfactory/ssh-agent@v0.9.1
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.14
hooks:
- id: ruff
args: [ --fix ]
- id: ruff-format

- repo: https://github.com/tox-dev/pyproject-fmt
rev: v2.12.1
hooks:
- id: pyproject-fmt

- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.24.1
hooks:
- id: validate-pyproject
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 🎤 programapi

This project powers the **EuroPython 2025** website, Discord bot, and internal bot 🦜 by downloading, transforming, and serving clean, structured JSON files for sessions, speakers, and the schedule, all pulled from Pretalx.

Built for transparency. Designed for reuse. Optimized for EuroPython.

Expand Down Expand Up @@ -87,14 +87,14 @@ PRETALX_TOKEN=your_api_token_here
Hosted at:

```
https://static.europython.eu/programme/ep2025/releases/current
```

| Endpoint | Description |
|-----------------------------------------------------------------------------------------------------|-------------------------------|
| [`/speakers.json`](https://static.europython.eu/programme/ep2025/releases/current/speakers.json) | List of confirmed speakers |
| [`/sessions.json`](https://static.europython.eu/programme/ep2025/releases/current/sessions.json) | List of confirmed sessions |
| [`/schedule.json`](https://static.europython.eu/programme/ep2025/releases/current/schedule.json) | Latest conference schedule |

---

Expand All @@ -111,4 +111,4 @@ Feel free to open an issue or reach us at [infra@europython.eu](mailto:infra@eur

---

📅 Last updated for: **EuroPython 2025**
4 changes: 2 additions & 2 deletions data/examples/README.md
Original file line number Diff line number Diff line change
@@ -79,7 +79,7 @@
"description": "Slides for the session"
}
],
"room": "South Hall 2A",
"start": "2099-07-10T14:00:00+02:00",
"end": "2099-07-10T15:00:00+02:00",
"website_url": "https://ep2099.europython.eu/session/example-talk",
Expand Down @@ -211,6 +211,6 @@

### 🛠 Notes & Logic

- `room` normalization maps `"Main Hall"` sessions to `"Exhibit Hall"` — Poster sessions rejoice!
- All `"Registration & Welcome"` events automatically include **all active rooms**.
- Various `social_*_url` fields handle malformed inputs like `@name`, full URLs, or just `username`.
4 changes: 2 additions & 2 deletions data/examples/europython/sessions.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"sessions_before": null,
"next_session": null,
"prev_session": null,
"website_url": "https://ep2025.europython.eu/session/this-is-a-test-talk-from-a-test-speaker-about-a-test-topic",
"youtube_url": "https://youtube.com/watch?v=01234567890"
},
"B8CD4F": {
@@ -57,7 +57,7 @@
"sessions_before": null,
"next_session": null,
"prev_session": null,
"website_url": "https://ep2025.europython.eu/session/a-talk-with-shorter-title",
"youtube_url": "https://youtube.com/watch?v=12345679012"
}
}
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "programapi"
version = "2025.4.5"
description = "Programme API for EuroPython"
readme = "README.md"
requires-python = ">=3.12"
Expand Down
15 changes: 9 additions & 6 deletions src/models/pretalx.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,17 @@ def process_values(cls, values) -> dict:
]
values["resources"] = resources

# Set slot information
if values.get("slots"):
first_slot = PretalxSlot.model_validate(values["slots"][0])
values["room"] = first_slot.room
values["start"] = first_slot.start

last_slot = PretalxSlot.model_validate(values["slots"][-1])
values["end"] = last_slot.end

return values

Expand Down
24 changes: 18 additions & 6 deletions src/utils/timing_relationships.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,38 @@ class TimingRelationships:
def compute(
cls, all_sessions: ValuesView[PretalxSubmission] | list[PretalxSubmission]
) -> None:
for session in all_sessions:
if not session.start or not session.end:
continue

sessions_in_parallel = cls.compute_sessions_in_parallel(
session, all_sessions
)
sessions_after = cls.compute_sessions_after(
session, all_sessions, sessions_in_parallel
)
sessions_before = cls.compute_sessions_before(
session, all_sessions, sessions_in_parallel
)

cls.all_sessions_in_parallel[session.code] = sessions_in_parallel
cls.all_sessions_after[session.code] = sessions_after
cls.all_sessions_before[session.code] = sessions_before
cls.all_next_session[session.code] = cls.compute_prev_or_next_session(
session, sessions_after, all_sessions
)
cls.all_prev_session[session.code] = cls.compute_prev_or_next_session(
session, sessions_before, all_sessions
)

@classmethod
Expand Down Expand Up @@ -70,7 +80,9 @@ def compute_sessions_in_parallel(
if (
other_session.code == session.code
or other_session.start is None
or session.start is None
):
continue

Expand Down
5 changes: 5 additions & 0 deletions src/utils/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ def pretalx_submissions_to_europython_sessions(
next_session=TimingRelationships.get_next_session(submission.code),
prev_session=TimingRelationships.get_prev_session(submission.code),
slot_count=submission.slot_count,
youtube_url=youtube_data.get(submission.code),
)
ep_sessions[code] = ep_session
Expand Down
Loading
Toggle all file notes Toggle all file annotations