Skip to content

Commit 4ec9c66

Browse files
authored
Merge pull request #2 from EuroPython/fixes-additions
Fix test, change path handling, turn config into a class, add example speaker data
2 parents 3910f6d + f2a80eb commit 4ec9c66

File tree

15 files changed

+317
-37
lines changed

15 files changed

+317
-37
lines changed

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
src/config.toml
2-
31
# Byte-compiled / optimized / DLL files
42
__pycache__/
53
*.py[cod]

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ RUN pip install -r requirements.txt
88
COPY src/ ./src/
99
COPY Makefile .
1010

11-
RUN mkdir -p /srv/data/raw/europython-2024
12-
RUN mkdir -p /srv/data/public/2024/
11+
RUN mkdir -p /srv/data/raw/europython-2024/
12+
RUN mkdir -p /srv/data/public/europython-2024/
1313

1414

1515
CMD ["make", "all"]

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ deps/install:
1111
install: deps/install
1212

1313
download:
14-
cd src && python download.py
14+
python -m src.download
1515

1616
transform:
17-
cd src && python transform.py
17+
python -m src.transform
1818

1919

2020
all: download transform

data/examples/output/speakers.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"F3DC8A": {
3+
"code": "F3DC8A",
4+
"name": "A Speaker",
5+
"biography": null,
6+
"avatar": "https://pretalx.com/media/avatars/picture.jpg",
7+
"slug": "a-speaker",
8+
"submissions": [],
9+
"affiliation": "A Company",
10+
"homepage": null,
11+
"twitter": null,
12+
"mastodon": null
13+
}
14+
}
Lines changed: 267 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,267 @@
1-
{}
1+
[
2+
{
3+
"code": "F3DC8A",
4+
"name": "A Speaker",
5+
"biography": null,
6+
"submissions": [
7+
"A8CD3F"
8+
],
9+
"avatar": "https://pretalx.com/media/avatars/picture.jpg",
10+
"answers": [
11+
{
12+
"id": 272244,
13+
"question": {
14+
"id": 3406,
15+
"question": {
16+
"en": "Outline"
17+
}
18+
},
19+
"answer": "This is an outline",
20+
"answer_file": null,
21+
"submission": "A8CD3F",
22+
"review": null,
23+
"person": null,
24+
"options": []
25+
},
26+
{
27+
"id": 272245,
28+
"question": {
29+
"id": 3435,
30+
"question": {
31+
"en": "Country of residence"
32+
}
33+
},
34+
"answer": "Pythonland",
35+
"answer_file": null,
36+
"submission": null,
37+
"review": null,
38+
"person": "F3DC8A",
39+
"options": []
40+
},
41+
{
42+
"id": 272246,
43+
"question": {
44+
"id": 3433,
45+
"question": {
46+
"en": "Are you under the age of 18 on July 8th, 2024?"
47+
}
48+
},
49+
"answer": "no",
50+
"answer_file": null,
51+
"submission": null,
52+
"review": null,
53+
"person": "F3DC8A",
54+
"options": [
55+
{
56+
"id": 4543,
57+
"answer": {
58+
"en": "no"
59+
}
60+
}
61+
]
62+
},
63+
{
64+
"id": 272247,
65+
"question": {
66+
"id": 3434,
67+
"question": {
68+
"en": "Social (Github/Gitlab)"
69+
}
70+
},
71+
"answer": "https://github.com/F3DC8A",
72+
"answer_file": null,
73+
"submission": null,
74+
"review": null,
75+
"person": "F3DC8A",
76+
"options": []
77+
},
78+
{
79+
"id": 272248,
80+
"question": {
81+
"id": 3415,
82+
"question": {
83+
"en": "Social (LinkedIn)"
84+
}
85+
},
86+
"answer": "https://www.linkedin.com/in/F3DC8A/",
87+
"answer_file": null,
88+
"submission": null,
89+
"review": null,
90+
"person": "F3DC8A",
91+
"options": []
92+
},
93+
{
94+
"id": 272249,
95+
"question": {
96+
"id": 3420,
97+
"question": {
98+
"en": "My presentation can be delivered"
99+
}
100+
},
101+
"answer": "in-person at the conference venue",
102+
"answer_file": null,
103+
"submission": "A8CD3F",
104+
"review": null,
105+
"person": null,
106+
"options": [
107+
{
108+
"id": 4500,
109+
"answer": {
110+
"en": "in-person at the conference venue"
111+
}
112+
}
113+
]
114+
},
115+
{
116+
"id": 272250,
117+
"question": {
118+
"id": 3421,
119+
"question": {
120+
"en": "Public link to supporting material."
121+
}
122+
},
123+
"answer": "https://example.com/material",
124+
"answer_file": null,
125+
"submission": "A8CD3F",
126+
"review": null,
127+
"person": null,
128+
"options": []
129+
},
130+
{
131+
"id": 272251,
132+
"question": {
133+
"id": 3425,
134+
"question": {
135+
"en": "Do you identify as a member of an underrepresented group in computing."
136+
}
137+
},
138+
"answer": "no",
139+
"answer_file": null,
140+
"submission": null,
141+
"review": null,
142+
"person": "F3DC8A",
143+
"options": [
144+
{
145+
"id": 4504,
146+
"answer": {
147+
"en": "no"
148+
}
149+
}
150+
]
151+
},
152+
{
153+
"id": 272252,
154+
"question": {
155+
"id": 3427,
156+
"question": {
157+
"en": "If yes, with which of the following do you identify with"
158+
}
159+
},
160+
"answer": "",
161+
"answer_file": null,
162+
"submission": null,
163+
"review": null,
164+
"person": "F3DC8A",
165+
"options": []
166+
},
167+
{
168+
"id": 272253,
169+
"question": {
170+
"id": 3428,
171+
"question": {
172+
"en": "Position /Job"
173+
}
174+
},
175+
"answer": "EuroPython Enjoyer",
176+
"answer_file": null,
177+
"submission": null,
178+
"review": null,
179+
"person": "F3DC8A",
180+
"options": []
181+
},
182+
{
183+
"id": 272254,
184+
"question": {
185+
"id": 3429,
186+
"question": {
187+
"en": "Are you planning to apply for Financial Aid?"
188+
}
189+
},
190+
"answer": "no",
191+
"answer_file": null,
192+
"submission": "A8CD3F",
193+
"review": null,
194+
"person": null,
195+
"options": [
196+
{
197+
"id": 4565,
198+
"answer": {
199+
"en": "no"
200+
}
201+
}
202+
]
203+
},
204+
{
205+
"id": 272255,
206+
"question": {
207+
"id": 3431,
208+
"question": {
209+
"en": "Company / Organization / Educational Institution"
210+
}
211+
},
212+
"answer": "A Company",
213+
"answer_file": null,
214+
"submission": null,
215+
"review": null,
216+
"person": "F3DC8A",
217+
"options": []
218+
},
219+
{
220+
"id": 272256,
221+
"question": {
222+
"id": 3424,
223+
"question": {
224+
"en": "I have read and agree to the Speaker Release Agreement"
225+
}
226+
},
227+
"answer": "yes",
228+
"answer_file": null,
229+
"submission": null,
230+
"review": null,
231+
"person": "F3DC8A",
232+
"options": [
233+
{
234+
"id": 4502,
235+
"answer": {
236+
"en": "yes"
237+
}
238+
}
239+
]
240+
},
241+
{
242+
"id": 272257,
243+
"question": {
244+
"id": 3412,
245+
"question": {
246+
"en": "Expected audience expertise"
247+
}
248+
},
249+
"answer": "Intermediate",
250+
"answer_file": null,
251+
"submission": "A8CD3F",
252+
"review": null,
253+
"person": null,
254+
"options": [
255+
{
256+
"id": 4495,
257+
"answer": {
258+
"en": "Intermediate"
259+
}
260+
}
261+
]
262+
}
263+
],
264+
"email": "f3dc8a@example.com",
265+
"availabilities": []
266+
}
267+
]

data/public/2024/speakers.json

Whitespace-only changes.

deploy/nginx.conf.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ http {
7676
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
7777

7878
location /2024 {
79-
alias /usr/share/static/2024;
79+
alias /usr/share/static/europython-2024;
8080
}
8181
}
8282
}

src/config.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
import os
2+
from pathlib import Path
23

3-
# with open("config.toml", "rb") as fd:
4-
# conf = tomllib.load(fd)
54

6-
conf = {
7-
"pretalx-token": os.environ["PRETALX_TOKEN"],
8-
}
5+
class Config:
6+
event = "europython-2024"
7+
project_root = Path(__file__).resolve().parents[1]
8+
raw_path = Path(f"{project_root}/data/raw/{event}")
9+
public_path = Path(f"{project_root}/data/public/{event}")
10+
11+
@staticmethod
12+
def token():
13+
return os.environ["PRETALX_TOKEN"]

0 commit comments

Comments
 (0)