From 4b917f31a9c7393aeb084f95eae5c7d426013f19 Mon Sep 17 00:00:00 2001 From: ReeseHatfield Date: Thu, 22 Jan 2026 09:14:05 -0500 Subject: [PATCH 1/3] add migration script --- migrations/categories_to_tags.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 migrations/categories_to_tags.py diff --git a/migrations/categories_to_tags.py b/migrations/categories_to_tags.py new file mode 100755 index 0000000..4d2a241 --- /dev/null +++ b/migrations/categories_to_tags.py @@ -0,0 +1,12 @@ +#!/bin/python3 + +import json, glob +from pathlib import Path +# run me from top level oseda-lib dir +for course in Path("./courses").iterdir(): + print(f"{course}") + +# for f in glob.glob('*.json'): +# j=json.load(open(f)) +# j['newField']=j.pop('oldField') +# json.dump(j,open(f,'w'),indent=2) From 759f0b1e9e1af5ba89e726bcb13c96f4164ab9e8 Mon Sep 17 00:00:00 2001 From: ReeseHatfield Date: Thu, 22 Jan 2026 09:14:27 -0500 Subject: [PATCH 2/3] format --- migrations/categories_to_tags.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/migrations/categories_to_tags.py b/migrations/categories_to_tags.py index 4d2a241..5aefd91 100755 --- a/migrations/categories_to_tags.py +++ b/migrations/categories_to_tags.py @@ -2,11 +2,13 @@ import json, glob from pathlib import Path + # run me from top level oseda-lib dir for course in Path("./courses").iterdir(): - print(f"{course}") + oseda_conf_file = f"{course}/oseda-config.json" + + j = json.load(open(oseda_conf_file)) + j['tags'] = j.pop('categories') + json.dump(j, open(f,'w'), indent=2) + -# for f in glob.glob('*.json'): -# j=json.load(open(f)) -# j['newField']=j.pop('oldField') -# json.dump(j,open(f,'w'),indent=2) From d82d2f6a01c2d96b1096fd9c7421f7bb609b5bbb Mon Sep 17 00:00:00 2001 From: ReeseHatfield Date: Thu, 22 Jan 2026 09:16:04 -0500 Subject: [PATCH 3/3] migrate existing courses to tags --- courses/BotanicalGardens/oseda-config.json | 8 ++++---- courses/CategoryTheory/oseda-config.json | 10 +++++----- courses/Compilers/oseda-config.json | 11 +++++------ courses/German-101/oseda-config.json | 7 +++---- .../oseda-config.json | 11 +++++------ courses/IntroToRust/oseda-config.json | 8 ++++---- courses/PlasticsAndTheirUses/oseda-config.json | 11 +++++------ courses/Puzzles/oseda-config.json | 8 ++++---- courses/RaspberryPis101/oseda-config.json | 8 ++++---- courses/TouchingGrass/oseda-config.json | 10 +++++----- migrations/categories_to_tags.py | 4 ++-- 11 files changed, 46 insertions(+), 50 deletions(-) diff --git a/courses/BotanicalGardens/oseda-config.json b/courses/BotanicalGardens/oseda-config.json index d1a49d5..12a2b14 100644 --- a/courses/BotanicalGardens/oseda-config.json +++ b/courses/BotanicalGardens/oseda-config.json @@ -1,9 +1,9 @@ { "title": "BotanicalGardens", "author": "ReeseHatfield", - "category": [ - "Science" - ], "last_updated": "2025-11-26T21:41:51.195600391Z", - "color": "#008000" + "color": "#008000", + "tags": [ + "Science" + ] } \ No newline at end of file diff --git a/courses/CategoryTheory/oseda-config.json b/courses/CategoryTheory/oseda-config.json index d1ffa46..37d6209 100644 --- a/courses/CategoryTheory/oseda-config.json +++ b/courses/CategoryTheory/oseda-config.json @@ -1,10 +1,10 @@ { "title": "CategoryTheory", "author": "ReeseHatfield", - "category": [ + "last_updated": "2025-07-11T20:06:49.100163429Z", + "color": "#4287f5", + "tags": [ "ComputerScience", "Mathematics" - ], - "last_updated": "2025-07-11T20:06:49.100163429Z", - "color" : "#4287f5" -} + ] +} \ No newline at end of file diff --git a/courses/Compilers/oseda-config.json b/courses/Compilers/oseda-config.json index 12f8512..59225a9 100644 --- a/courses/Compilers/oseda-config.json +++ b/courses/Compilers/oseda-config.json @@ -1,10 +1,9 @@ { "title": "Compilers", "author": "ReeseHatfield", - "category": [ - "ComputerScience" - ], "last_updated": "2025-07-11T02:52:41.385842008Z", - "color" : "#4287f5" - -} + "color": "#4287f5", + "tags": [ + "ComputerScience" + ] +} \ No newline at end of file diff --git a/courses/German-101/oseda-config.json b/courses/German-101/oseda-config.json index d5e19de..9a91f2f 100644 --- a/courses/German-101/oseda-config.json +++ b/courses/German-101/oseda-config.json @@ -1,8 +1,7 @@ { "title": "German-101", "author": "Blake Payne", - "category": [], "last_updated": "2025-07-09T20:47:03.317223199Z", - "color" : "#4287f5" - -} + "color": "#4287f5", + "tags": [] +} \ No newline at end of file diff --git a/courses/ImSittingAtAWinansAndAmGoingInsane/oseda-config.json b/courses/ImSittingAtAWinansAndAmGoingInsane/oseda-config.json index 82c8d7d..9713c37 100644 --- a/courses/ImSittingAtAWinansAndAmGoingInsane/oseda-config.json +++ b/courses/ImSittingAtAWinansAndAmGoingInsane/oseda-config.json @@ -1,11 +1,10 @@ { "title": "ImSittingAtAWinansAndAmGoingInsane", "author": "ReeseHatfield", - "category": [ + "last_updated": "2025-07-08T23:13:41.293932232Z", + "color": "#4287f5", + "tags": [ "ComputerScience", "Engineering" - ], - "last_updated": "2025-07-08T23:13:41.293932232Z", - "color" : "#4287f5" - -} + ] +} \ No newline at end of file diff --git a/courses/IntroToRust/oseda-config.json b/courses/IntroToRust/oseda-config.json index 225ecd5..42ef874 100644 --- a/courses/IntroToRust/oseda-config.json +++ b/courses/IntroToRust/oseda-config.json @@ -1,9 +1,9 @@ { "title": "IntroToRust", "author": "ReeseHatfield", - "category": [ - "ComputerScience" - ], "last_updated": "2025-11-12T14:52:18.608425697Z", - "color": "#FFA500" + "color": "#FFA500", + "tags": [ + "ComputerScience" + ] } \ No newline at end of file diff --git a/courses/PlasticsAndTheirUses/oseda-config.json b/courses/PlasticsAndTheirUses/oseda-config.json index 25f3561..45741f2 100644 --- a/courses/PlasticsAndTheirUses/oseda-config.json +++ b/courses/PlasticsAndTheirUses/oseda-config.json @@ -1,10 +1,9 @@ { "title": "PlasticsAndTheirUses", "author": "ReeseHatfield", - "category": [ - "ComputerScience" - ], "last_updated": "2025-07-09T00:10:12.009530562Z", - "color" : "#4287f5" - -} + "color": "#4287f5", + "tags": [ + "ComputerScience" + ] +} \ No newline at end of file diff --git a/courses/Puzzles/oseda-config.json b/courses/Puzzles/oseda-config.json index 37986ba..d17ae12 100644 --- a/courses/Puzzles/oseda-config.json +++ b/courses/Puzzles/oseda-config.json @@ -1,9 +1,9 @@ { "title": "Puzzles", "author": "ReeseHatfield", - "category": [ - "Aerospace" - ], "last_updated": "2025-11-26T21:54:33.483747297Z", - "color": "#000000" + "color": "#000000", + "tags": [ + "Aerospace" + ] } \ No newline at end of file diff --git a/courses/RaspberryPis101/oseda-config.json b/courses/RaspberryPis101/oseda-config.json index 91202b2..f5dc921 100644 --- a/courses/RaspberryPis101/oseda-config.json +++ b/courses/RaspberryPis101/oseda-config.json @@ -1,10 +1,10 @@ { "title": "RaspberryPis101", "author": "ReeseHatfield", - "category": [ + "last_updated": "2025-11-26T21:26:29.767286520Z", + "color": "#FF0000", + "tags": [ "ComputerScience", "Engineering" - ], - "last_updated": "2025-11-26T21:26:29.767286520Z", - "color": "#FF0000" + ] } \ No newline at end of file diff --git a/courses/TouchingGrass/oseda-config.json b/courses/TouchingGrass/oseda-config.json index 030d423..05a8a22 100644 --- a/courses/TouchingGrass/oseda-config.json +++ b/courses/TouchingGrass/oseda-config.json @@ -1,9 +1,9 @@ { "title": "TouchingGrass", "author": "ReeseHatfield", - "category": [ - "ComputerScience" - ], "last_updated": "2025-07-08T23:35:13.890968259Z", - "color" : "#4287f5" -} + "color": "#4287f5", + "tags": [ + "ComputerScience" + ] +} \ No newline at end of file diff --git a/migrations/categories_to_tags.py b/migrations/categories_to_tags.py index 5aefd91..a4dca5f 100755 --- a/migrations/categories_to_tags.py +++ b/migrations/categories_to_tags.py @@ -8,7 +8,7 @@ oseda_conf_file = f"{course}/oseda-config.json" j = json.load(open(oseda_conf_file)) - j['tags'] = j.pop('categories') - json.dump(j, open(f,'w'), indent=2) + j['tags'] = j.pop('category') + json.dump(j, open(oseda_conf_file,'w'), indent=2)