https://github.com/amogorkon/datenine
https://github.com/amogorkon/datenine
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/amogorkon/datenine
- Owner: amogorkon
- Created: 2021-02-02T14:38:33.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-02-02T15:49:57.000Z (over 4 years ago)
- Last Synced: 2025-01-22T20:51:38.029Z (5 months ago)
- Language: Jupyter Notebook
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# DateNine - a Grammar of Dates
## What's datenine and how is it different?
I needed a simple way to describe recurring times, so I looked into different approaches.
Schedule is a nice enough python package, but it actually *schedules* events - I only need to describe a date that may be months or years away
and calculate its future timestamp from the description.The simplest case is, I have a birthdate I need to remember and I want to say "give me the timestamp that corresponds to 2 days before the next birthday"
Which is remarkably difficult in other approaches for a simple task like this.So, what would this usecase look like in datenine?
Date(1992,5,25) * year() - day(2)This means: the fixed Date * every year - two days before the next date
Multiplication means "every", - or + shifts the date from the next occurrence and you can add modifiers or constraints to each part.