Skip to content

Python code to determine whether a given date is a DSNY holiday

Notifications You must be signed in to change notification settings

vjp23/DSNYHolidays

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DSNY Holidays

Python code to determine whether a given date is a New York Department of Sanitation (DSNY) holiday.

Note that this code will NOT indicate whether DSNY is picking up on a given day, as there are other factors that they use to determine this. For example, if there's a blizzard preventing collection between two holidays, there may be collection on the second holiday to avoid a backlog.

With that said, the DSNY holiday calendar is nontrivial, so I hope that this will be of some use.

I expect that this will be primarily useful for New York City residents.

Usage

from datetime import date
from dsny_holidays import is_dsny_holiday


new_years_day = date(2021, 1, 1)
is_holiday, holiday_name = is_dsny_holiday(new_years_day)

print(is_holiday)
>> True

print(holiday_name)
>> New Years Day

References

https://dsnyfamily.com/dsny-holidays/

https://www1.nyc.gov/assets/dsny/site/services/waste-page/holiday-schedule

TODO

  1. Add a function to return the next pickup date that is NOT a holiday following a specified pickup date, given a pickup schedule and a collection type (refuse vs recycling vs, if possible, organics)

About

Python code to determine whether a given date is a DSNY holiday

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages