Last active
May 21, 2024 20:37
-
-
Save strugee/eb1ef37bb15e70ce87710475017cde33 to your computer and use it in GitHub Desktop.
Don't worry about it just some PyCon US 2024 shenanigans it'll be good I promise
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# This is Creative Commons Zero licensed my dudes | |
# https://creativecommons.org/publicdomain/zero/1.0/legalcode | |
# (C) 2024 Absolutely Fuckin Nobody ideally | |
# No you don't get any decent comments | |
# (Sorry not sorry) | |
from datetime import date | |
start_year = 2024 | |
regional_pycons = { | |
"US": 2003, | |
"Kiwi": 2009, | |
"AR": 2017, | |
"AU": 2010, | |
"Brasil": 2005, | |
"CA": 2012, | |
"Chile": 2021, | |
"China": 2011, | |
"Columbia": 2016, | |
"CZ": 2015, | |
"Euro": 2002, | |
"FR": 2010, | |
"DE": 2011, | |
"Ghana": 2018, | |
"Hong Kong": 2018, | |
"APAC": 2024, | |
"India": 2019, | |
"Iran": 2021, | |
"Ireland": 2015, | |
"Israel": 2016, | |
# TODO the rest of them lol | |
# https://pycon.org/#national-conferences | |
# Also regional confs probably | |
} | |
scotch_years = ( | |
17, | |
# TODO there were more | |
) | |
pyboats = {} | |
# TODO DRY | |
for target_year in range(start_year, start_year + 20): | |
pyboats[target_year] = [] | |
for conf_name, conf_year in regional_pycons.items(): | |
for scotch_year in scotch_years: | |
for target_year in range(start_year, start_year + 20): | |
if conf_year + scotch_year == target_year: | |
pyboats[target_year].append((conf_name, scotch_year)) | |
for year, lst in pyboats.items(): | |
if not lst: | |
continue | |
scotch_years = {} | |
# XXX there's some stdlib module to do this I'm pretty sure | |
for conf_name, scotch_year in lst: | |
scotch_years.setdefault(scotch_year, []) | |
scotch_years[scotch_year].append(conf_name) | |
scotch_year_texts = [] | |
for scotch_year, conf_names in scotch_years.items(): | |
conf_list = ", ".join([f"PyCon {i}" for i in conf_names]) | |
conf_list = conf_list.replace("PyCon Kiwi", "Kiwi PyCon") | |
scotch_year_texts.append(f"{scotch_year}-year scotch ({conf_list})") | |
if len(scotch_year_texts) == 1: | |
scotch_text = scotch_year_texts[0] | |
elif len(scotch_year_texts) == 2: | |
scotch_text = " and ".join(scotch_year_texts) | |
else: | |
scotch_text[-1] = "and " + scotch_text[-1] | |
scotch_text = ", ".join(scotch_year_texts) | |
print( | |
f"There will be a PyBoat Yacht-as-a-Service event in {year} serving {scotch_text}. The boat captain/czar will be AJ, as dictated by the power of quorum." | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment