Skip to content

Commit d2a9916

Browse files
authored
Sps25 add speaker slides (#103)
* wip * mv out from 24 * wip slides content * improve recordings so empty video url also does not link * add talk recording (no slides, no video) * add medi.ccc playlist * add first slides * add news to homepage * add lightning talks * imporve filenames, news * rm year from project * fix/enable secondary color and btn * mv video from title link next to [slides] * rename talk-recordings to recordings * add and optimize recording page * fix remove pdf because is it no always a pdf * add "casual ml" slides * mark program as past
1 parent 4a3f3ed commit d2a9916

File tree

304 files changed

+1127
-68
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

304 files changed

+1127
-68
lines changed

README.md

Lines changed: 1 addition & 1 deletion

scripts/recordings/README.md

Lines changed: 17 additions & 2 deletions

scripts/recordings/csv_2_content.py

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,18 @@
44
import re
55
import shutil
66

7-
FILE_DIR = Path("scripts/recordings/sps24")
8-
assert FILE_DIR.exists(), "FILE_DIR does not exist"
7+
# START Change these two
8+
CONF_YEAR_SLUG = "25"
9+
# END
910

10-
CSV_PATH = FILE_DIR / "talks.csv"
11+
BASE_DIR = Path(f"scripts/recordings/sps{CONF_YEAR_SLUG}")
12+
CONF_SHORT = f"SPS{CONF_YEAR_SLUG}"
13+
CONF_YEAR = f"20{CONF_YEAR_SLUG}"
14+
CSV_PATH = BASE_DIR / "talks.csv"
1115

16+
assert BASE_DIR.exists(), "BASE_DIR does not exist"
17+
assert CSV_PATH.exists(), "CSV_PATH not found"
1218

13-
CONF_SHORT = "SPS24"
14-
CONF_YEAR = "2024"
15-
16-
OUTPUT_FOLDER = Path("scripts/recordings/out")
1719

1820
def get_data(csv_path, filter_type=["Talk", "Keynote", "Lightning Talks (9x5min)"]):
1921
df = pd.read_csv(csv_path)
@@ -22,28 +24,27 @@ def get_data(csv_path, filter_type=["Talk", "Keynote", "Lightning Talks (9x5min)
2224
return df
2325

2426
def create_file_structure(df: pd.DataFrame):
25-
# if OUTPUT_FOLDER.exists():
26-
# shutil.rmtree(OUTPUT_FOLDER)
27-
OUTPUT_FOLDER.mkdir(exist_ok=False)
27+
out_dir = BASE_DIR / "content"
28+
out_dir.mkdir(exist_ok=False) # Warn user if it exists
2829
for i, row in df.iterrows():
29-
filename = Path(OUTPUT_FOLDER / row.filename)
30+
filename = Path(out_dir / row.filename)
3031
filename.mkdir()
3132
content = filename / "contents.lr"
32-
content.write_text(create_content(i, row))
33+
content.write_text(create_content(row))
3334
slide = filename / f"{filename.name}.pdf.lr"
3435
slide.write_text("type: slides")
3536

36-
def create_content(i, row):
37+
def create_content(row):
3738
text = f'''
3839
_model: recording
3940
---
4041
title: {row.title}
4142
---
42-
ordering: {i}
43+
ordering: {row.talk_idx}
4344
---
4445
speaker: {row.names_combined}
4546
---
46-
video_url: {row.video_url}
47+
video_url: {row.video_url if row.video_url != "<VIDEO_URL>" else ""}
4748
---
4849
year: {CONF_YEAR} - Day {row.day}
4950
'''

scripts/recordings/pretalx_2_csv.py renamed to scripts/recordings/schedule_2_csv.py

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,29 @@
1+
'''
2+
Script to convert pretalx schedule.json to a CSV file.
3+
It can be used to easy copy the data to Youtube upload forms and name the slides pdf properly.
4+
'''
5+
16
import pandas as pd
27
from pathlib import Path
38
import json
49
import re
510
from datetime import datetime
11+
from textwrap import dedent
12+
13+
# START Change these two
14+
CONF_YEAR_SLUG = "25"
15+
# END
616

7-
FILE_DIR = Path("scripts/recordings/sps24")
8-
assert FILE_DIR.exists(), "FILE_DIR does not exist"
17+
BASE_DIR = Path(f"scripts/recordings/sps{CONF_YEAR_SLUG}")
18+
CONF_SHORT = f"SPS{CONF_YEAR_SLUG}"
19+
CONF_YEAR = f"20{CONF_YEAR_SLUG}"
920

10-
CSV_PATH = FILE_DIR / "talks.csv"
11-
PRETALX_SCHEDULE_PATH = FILE_DIR / "schedule.json"
1221

13-
CONF_SHORT = "SPS24"
22+
assert BASE_DIR.exists(), "FILE_DIR does not exist"
23+
24+
PRETALX_SCHEDULE_PATH = BASE_DIR / "schedule.json"
25+
CSV_PATH = BASE_DIR / "talks.csv"
26+
1427

1528
def get_talks_data(schedule_path = PRETALX_SCHEDULE_PATH):
1629
schedule_data = json.loads(schedule_path.read_text())
@@ -19,11 +32,12 @@ def get_talks_data(schedule_path = PRETALX_SCHEDULE_PATH):
1932
day_idx = day["index"]
2033
print(f"Processing day {day_idx}")
2134
room_name = next(iter(day["rooms"]))
22-
for talk in day["rooms"][room_name]:
23-
print(f"\tProcessing talks #{talk['id']}")
35+
for i, talk in enumerate(day["rooms"][room_name]):
36+
print(f"\tProcessing talk #{talk['id']}")
2437
names, bios = zip(*[(d["public_name"], d["biography"] if d["biography"] else "") for d in talk["persons"]])
2538
talk_data = dict(
2639
day = day_idx,
40+
talk_idx = i,
2741
date = talk["date"],
2842
title = talk["title"],
2943
type = talk["type"],
@@ -54,15 +68,15 @@ def enrich(talks):
5468
named_title = f'{names} - {talk["title"]}'
5569
talk["named_title"] = named_title
5670
talk["video_title"] = f"{named_title} - {CONF_SHORT}"
57-
filename = clean_filename(f"{CONF_SHORT}_{named_title}")
71+
filename = clean_filename(f"{CONF_SHORT}_{talk['day']}-{talk['talk_idx']:02d}_{named_title}")
5872
talk["filename"] = filename
59-
talk["video_url"] = "<TODO>"
73+
talk["video_url"] = "<VIDEO_URL>" # fill in manually later when the video is uploaded
6074
talk["biographies_combined"] = "\n\n".join(talk["biographies_raw"])
6175
talk["date_str"] = talk["date"]
6276
# Title and Description for youtube
6377
talk["video_text"] = f'{talk["names_combined"]}{talk["title"]}{CONF_SHORT}'
64-
talk["video_text"] = f'''Talk recorded at the Swiss Python Summit on {timestring(talk["date"])}.
65-
78+
talk["video_text"] = f'''
79+
Talk recorded at the Swiss Python Summit on {timestring(talk["date"])}.
6680
Licensed as Creative Commons Attribution 4.0 International.
6781
6882
---------
@@ -74,7 +88,7 @@ def enrich(talks):
7488
About the speaker(s):
7589
7690
{talk["biographies_combined"]}
77-
'''
91+
'''.lstrip()
7892
return talks
7993

8094
def clean_filename(filename, max_length=70):
@@ -122,7 +136,7 @@ def main():
122136
df = pd.DataFrame(data)
123137
df.to_csv(CSV_PATH)
124138
short_csv_path = CSV_PATH.parent / (CSV_PATH.stem + "_notext" + CSV_PATH.suffix)
125-
# print(short_csv_path)
139+
print("CSV saved to:", CSV_PATH)
126140
# drop multiline texts
127141
df.drop(["abstract","biographies_raw", "biographies_combined", "video_text"], axis=1).to_csv(short_csv_path)
128142

0 commit comments

Comments
 (0)