Last active
October 27, 2025 09:37
-
-
Save nicman23/53e21c513993a0413cd02022562d09c3 to your computer and use it in GitHub Desktop.
Get offdays for pharmacies in greece with easter calculation and all the relevant easter adjucted offdays
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
| #!/bin/env -i python | |
| from datetime import * | |
| from dateutil.easter import * | |
| import sys | |
| import json | |
| def get_offdays(year): | |
| return [ | |
| date(year, 1, 1), | |
| date(year, 1, 6), | |
| date(year, 3, 25), | |
| date(year, 5, 1), | |
| date(year, 8, 15), | |
| date(year, 9, 14), | |
| date(year, 10, 28), | |
| date(year, 12, 25), | |
| date(year, 12, 26), | |
| easter(year, 2), | |
| easter(year, 2) + timedelta(days=1), | |
| easter(year, 2) + timedelta(days=50), | |
| easter(year, 2) - timedelta(days=48) #ka8ara deytera | |
| ] | |
| if __name__ == '__main__': | |
| year = int(sys.argv[1]) | |
| offdays = get_offdays(year) | |
| json.dump([o.isoformat() for o in offdays], sys.stdout) | |
| sys.stdout.write('\n') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment