Closed ykdojo closed 2 years ago
{ id: 1, quote: "reminder 1", category:["health reminders", "category2" , "category3" ] }
Hmm @AevumElectronics, rather than that, I think the top items should be the categories - so it's easier for people to contribute
I agree that it will be easier to contribute if the top items are categories. I also think it would help if the reminders file is as human-readable as possible. For example, do we need the quotes? How about this:
Health Reminders:
- Reminder 1
- Reminder 2
Productivity Reminders:
- Reminder 3
- Reminder 4
Having no quotes would complicate the logic slightly in main.py, but it would make reminders.txt more pleasing to look at and work with.
@ekand that looks great and I love it!
does that format work in a yaml?
@ykdojo I will research the specification for yaml, and get back to you. I think it might need indentation to fit yaml requirements.
@ykdojo On further inspection, the format I suggested above is valid yaml.
I tested it with import yaml
, and it ended up making a python object like this:
with open('reminders.txt') as f: categories = yaml.load(f.read(), Loader=yaml.FullLoader)
pprint.pprint(categories)
{'Health Reminders': ['Hey human, remember to drink water',
'Hey human, remember to stand up and stretch',
'Hey human, remember to exercise from time to time', # and so on...
as we have more and more reminders, it'd be nice to have a way to categorize them better so they're easier to contribute to.
should they be maybe in a JSON or YAML file, for example?
it could look like: