Skip to content

Commit

Permalink
fix bic ics convert
Browse files Browse the repository at this point in the history
  • Loading branch information
captn3m0 committed Apr 12, 2024
1 parent f2fb037 commit 5f7253a
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 22 deletions.
80 changes: 71 additions & 9 deletions out/bic.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
},
"url": "https://bangaloreinternationalcentre.org/event/living-wills/",
"keywords": "Law, Society",
"inLanguage": "en",
"image": "https://bangaloreinternationalcentre.org/wp-content/uploads/Thumbnail_POSTER-424.jpg"
},
{
Expand All @@ -27,11 +28,12 @@
},
"url": "https://bangaloreinternationalcentre.org/event/make-believe/",
"keywords": "Architecture, Design, Visual Arts",
"inLanguage": "en",
"image": "https://bangaloreinternationalcentre.org/wp-content/uploads/Thumbnail_POSTER-430.jpg"
},
{
"@context": "http://schema.org",
"@type": "Event",
"@type": "ScreeningEvent",
"name": "Saga of a Poet",
"startDate": "2024-04-15T18:30:00+05:30",
"endDate": "2024-04-15T20:30:00+05:30",
Expand All @@ -42,11 +44,17 @@
},
"url": "https://bangaloreinternationalcentre.org/event/saga-of-a-poet/",
"keywords": "Film, Poetry",
"inLanguage": "ta",
"workPresented": {
"@type": "Movie",
"name": "Saga of a Poet"
},
"subtitleLanguage": "en",
"image": "https://bangaloreinternationalcentre.org/wp-content/uploads/Thumbnail_POSTER-426.jpg"
},
{
"@context": "http://schema.org",
"@type": "Event",
"@type": "MusicEvent",
"name": "Romantic Ties \u2014 Liszt, Brahms, Sciortino",
"startDate": "2024-04-24T19:00:00+05:30",
"endDate": "2024-04-24T20:30:00+05:30",
Expand All @@ -57,6 +65,11 @@
},
"url": "https://bangaloreinternationalcentre.org/event/romantic-ties-liszt-brahms-sciortino/",
"keywords": "Music, Performing Arts",
"inLanguage": "en",
"workPerformed": {
"@type": "CreativeWork",
"name": "Romantic Ties \u2014 Liszt, Brahms, Sciortino"
},
"image": "https://bangaloreinternationalcentre.org/wp-content/uploads/Thumbnail-Romantic-Ties.jpg"
},
{
Expand All @@ -72,11 +85,12 @@
},
"url": "https://bangaloreinternationalcentre.org/event/%e0%b2%aa%e0%b2%82%e0%b2%9a%e0%b2%ae-%e0%b2%aa%e0%b2%a6-panchama-pada/",
"keywords": "Culture*, Society, Theatre",
"inLanguage": "en",
"image": "https://bangaloreinternationalcentre.org/wp-content/uploads/Thumbnail_POSTER-433.jpg"
},
{
"@context": "http://schema.org",
"@type": "Event",
"@type": "MusicEvent",
"name": "Yaadey",
"startDate": "2024-04-21T17:30:00+05:30",
"endDate": "2024-04-21T19:00:00+05:30",
Expand All @@ -87,6 +101,11 @@
},
"url": "https://bangaloreinternationalcentre.org/event/yaadey/",
"keywords": "Music, Performing Arts",
"inLanguage": "en",
"workPerformed": {
"@type": "CreativeWork",
"name": "Yaadey"
},
"image": "https://bangaloreinternationalcentre.org/wp-content/uploads/Thumbnail_POSTER-422.jpg"
},
{
Expand All @@ -102,6 +121,7 @@
},
"url": "https://bangaloreinternationalcentre.org/event/echoes-of-ai/",
"keywords": "Books, Development, Nonfiction, Technology",
"inLanguage": "en",
"image": "https://bangaloreinternationalcentre.org/wp-content/uploads/Thumbnail_POSTER-438.jpg"
},
{
Expand All @@ -117,6 +137,7 @@
},
"url": "https://bangaloreinternationalcentre.org/event/understandning-theatre/",
"keywords": "Theatre, Workshops",
"inLanguage": "en",
"image": "https://bangaloreinternationalcentre.org/wp-content/uploads/Thumbnail_POSTER-418.jpg"
},
{
Expand All @@ -132,6 +153,7 @@
},
"url": "https://bangaloreinternationalcentre.org/event/china-through-another-prism/",
"keywords": "History, International Relations, Politics",
"inLanguage": "en",
"image": "https://bangaloreinternationalcentre.org/wp-content/uploads/Thumbnail_POSTER-400.jpg"
},
{
Expand All @@ -147,6 +169,7 @@
},
"url": "https://bangaloreinternationalcentre.org/event/the-costs-of-political-corruption/",
"keywords": "Books, Governance, Policy & Regulation, Politics, Society",
"inLanguage": "hi",
"image": "https://bangaloreinternationalcentre.org/wp-content/uploads/Thumbnail_POSTER-419.jpg"
},
{
Expand All @@ -162,11 +185,12 @@
},
"url": "https://bangaloreinternationalcentre.org/event/like-the-date-palm/",
"keywords": "Literature, Poetry",
"inLanguage": "en",
"image": "https://bangaloreinternationalcentre.org/wp-content/uploads/Thumbnail_POSTER-432.jpg"
},
{
"@context": "http://schema.org",
"@type": "Event",
"@type": "MusicEvent",
"name": "Vara Narada",
"startDate": "2024-04-25T18:30:00+05:30",
"endDate": "2024-04-25T20:15:00+05:30",
Expand All @@ -177,11 +201,16 @@
},
"url": "https://bangaloreinternationalcentre.org/event/vara-narada/",
"keywords": "Faith, Heritage, Music, Performing Arts",
"inLanguage": "sa",
"workPerformed": {
"@type": "CreativeWork",
"name": "Vara Narada"
},
"image": "https://bangaloreinternationalcentre.org/wp-content/uploads/Thumbnail_POSTER-437.jpg"
},
{
"@context": "http://schema.org",
"@type": "Event",
"@type": "TheaterEvent",
"name": "Tara's Trio",
"startDate": "2024-04-30T18:00:00+05:30",
"endDate": "2024-04-30T19:30:00+05:30",
Expand All @@ -192,6 +221,11 @@
},
"url": "https://bangaloreinternationalcentre.org/event/taras-trio/",
"keywords": "Performing Arts, Theatre",
"inLanguage": "en",
"workPerformed": {
"@type": "TheaterPlay",
"name": "Tara's Trio"
},
"image": "https://bangaloreinternationalcentre.org/wp-content/uploads/Thumbnail_POSTER-441.jpg"
},
{
Expand All @@ -207,6 +241,7 @@
},
"url": "https://bangaloreinternationalcentre.org/event/practicing-wildlife-conservation/",
"keywords": "Environment, Masterclass, Wildlife",
"inLanguage": "en",
"image": "https://bangaloreinternationalcentre.org/wp-content/uploads/Thumbnail_POSTER-434.jpg"
},
{
Expand All @@ -222,6 +257,7 @@
},
"url": "https://bangaloreinternationalcentre.org/event/%e0%b2%a8%e0%b3%80%e0%b2%b2%e0%b2%bf-%e0%b2%aa%e0%b2%b0%e0%b2%a6%e0%b3%86-neeli-parade-season-2/",
"keywords": "Film",
"inLanguage": "kn",
"image": "https://bangaloreinternationalcentre.org/wp-content/uploads/Thumbnail_POSTER-429.jpg"
},
{
Expand All @@ -237,6 +273,7 @@
},
"url": "https://bangaloreinternationalcentre.org/event/towards-digital-film-societies/",
"keywords": "Film, History, Media",
"inLanguage": "en",
"image": "https://bangaloreinternationalcentre.org/wp-content/uploads/Thumbnail_POSTER-431.jpg"
},
{
Expand All @@ -252,11 +289,12 @@
},
"url": "https://bangaloreinternationalcentre.org/event/the-rise-and-fall-of-the-vanderbilts/",
"keywords": "Books, Business, Nonfiction",
"inLanguage": "en",
"image": "https://bangaloreinternationalcentre.org/wp-content/uploads/Thumbnail_POSTER-428.jpg"
},
{
"@context": "http://schema.org",
"@type": "Event",
"@type": "ScreeningEvent",
"name": "The Ocean Connection",
"startDate": "2024-04-22T18:30:00+05:30",
"endDate": "2024-04-22T20:00:00+05:30",
Expand All @@ -267,11 +305,17 @@
},
"url": "https://bangaloreinternationalcentre.org/event/the-ocean-connection/",
"keywords": "Environment, Film, Sustainability, Wildlife",
"inLanguage": "kn",
"workPresented": {
"@type": "Movie",
"name": "The Ocean Connection"
},
"subtitleLanguage": "en",
"image": "https://bangaloreinternationalcentre.org/wp-content/uploads/Thumbnail_POSTER-436.jpg"
},
{
"@context": "http://schema.org",
"@type": "Event",
"@type": "TheaterEvent",
"name": "Beyond the Red Nose",
"startDate": "2024-04-28T11:00:00+05:30",
"endDate": "2024-04-28T12:30:00+05:30",
Expand All @@ -282,6 +326,11 @@
},
"url": "https://bangaloreinternationalcentre.org/event/beyond-the-red-nose/",
"keywords": "Health & Wellness, Performing Arts, Theatre, Workshops",
"inLanguage": "en",
"workPerformed": {
"@type": "TheaterPlay",
"name": "Beyond the Red Nose"
},
"image": "https://bangaloreinternationalcentre.org/wp-content/uploads/Thumbnail_POSTER-440.jpg"
},
{
Expand All @@ -297,11 +346,12 @@
},
"url": "https://bangaloreinternationalcentre.org/event/the-gods-who-come-down-from-heaven/",
"keywords": "Culture*, Faith, Heritage, History, Photography",
"inLanguage": "en",
"image": "https://bangaloreinternationalcentre.org/wp-content/uploads/Thumbnail-100.jpg"
},
{
"@context": "http://schema.org",
"@type": "Event",
"@type": "TheaterEvent",
"name": "Dvijottama",
"startDate": "2024-04-18T19:00:00+05:30",
"endDate": "2024-04-18T20:15:00+05:30",
Expand All @@ -312,6 +362,11 @@
},
"url": "https://bangaloreinternationalcentre.org/event/dvijottama/",
"keywords": "History, Mythology, Performing Arts, Theatre",
"inLanguage": "en",
"workPerformed": {
"@type": "TheaterPlay",
"name": "Dvijottama"
},
"image": "https://bangaloreinternationalcentre.org/wp-content/uploads/Thumbnail_POSTER-420.jpg"
},
{
Expand All @@ -327,11 +382,12 @@
},
"url": "https://bangaloreinternationalcentre.org/event/love-sex-and-algorithms/",
"keywords": "Bangalore, Books, Gender, Technology",
"inLanguage": "en",
"image": "https://bangaloreinternationalcentre.org/wp-content/uploads/Thumbnail-copy_POSTER-26.jpg"
},
{
"@context": "http://schema.org",
"@type": "Event",
"@type": "ScreeningEvent",
"name": "Asamana Anasuya",
"startDate": "2024-05-12T18:30:00+05:30",
"endDate": "2024-05-12T20:30:00+05:30",
Expand All @@ -342,6 +398,12 @@
},
"url": "https://bangaloreinternationalcentre.org/event/asamana-anasuya/",
"keywords": "Biography, Film, Music",
"inLanguage": "te",
"workPresented": {
"@type": "Movie",
"name": "Asamana Anasuya"
},
"subtitleLanguage": "en",
"image": "https://bangaloreinternationalcentre.org/wp-content/uploads/Thumbnail_POSTER-439.jpg"
}
]
3 changes: 2 additions & 1 deletion patch/mapindia.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"name": "Museum of Art & Photography (MAP)",
"address": "22, Kasturba Rd, Shanthala Nagar, Bengaluru, Karnataka 560001, India",
"url": "https://map-india.org/visit-us/",
"telephone": "+91 80 6933 4100"
"telephone": "+91 80 6933 4100",
"isicV4": "9102"
},
"eventStatus": "https://schema.org/EventScheduled",
"organizer": {
Expand Down
15 changes: 3 additions & 12 deletions src/ics-to-event.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"Sindhi": "sd"
}

def convert_ics_to_json(ics_file_path, event_dict):
def convert_ics_to_json(ics_file_path):
events = []

with open(ics_file_path, 'r') as file:
Expand All @@ -41,7 +41,7 @@ def convert_ics_to_json(ics_file_path, event_dict):
},
"url": event.url,
"keywords": ", ".join(sorted(event.categories)),
}.merge(event_dict)
}

for l in LANGUAGE_MAP:
regex = r"\b" + l + r"\b"
Expand Down Expand Up @@ -96,16 +96,7 @@ def convert_ics_to_json(ics_file_path, event_dict):
input_ics_file = sys.argv[1]
output_json_file = sys.argv[2]

# TODO: use a config file instead for these patches.
json_data = convert_ics_to_json(input_ics_file, {
"inLanguage": "en",
"eventStatus": "EventScheduled",
"organizer": {
"@type": "Organization",
"name": "Bangalore International Center",
"url": "https://bangaloreinternationalcentre.org/",
}
})
json_data = convert_ics_to_json(input_ics_file)

with open(output_json_file, 'w') as output_file:
output_file.write(json_data)
Expand Down

0 comments on commit 5f7253a

Please sign in to comment.