Package: python-networkdays
some statistics …Pypi VersionDoc StatusCoverageDownloadsBusiness days calendar.JobSchedule on business days.TipJust Python built-in libs, no dependenciesNetworkdays:Return working days between two dates exclude weekends and holidays.just like spreadsheetsnetwordaysfunctionexclude HolidaysExclude “days off” per week.Job schedule:Calculate the period for a given job hours, based onNetwordays.Table of ContentsInstallationFeaturesExamplesClass Networkdays.networkdaysclass Networkdays.jobscheduleOther similar projectsInstallationpython-networkdays can be installed from PyPI using pippipinstallpython-networkdaysTipnote that the package name is different from the importable namePage on Pypi:https://pypi.org/project/python-networkdays/There is no dependencies.FeaturesReturn a list of business days between 2 dates.Exclude weekends by defaultCustom “days off” may be informed as list like {1,2,3,4,5,6,7}, where 1 is Monday default is {6,7} = (Sat, Sun).How many business days between two dates.How many days off, including holidays and weekends.Return a list of business days for a given number of hoursReturn a list of Years, months or weeks for a given number of hoursNo Pandas or NumPy dependenciesExamplesClass Networkdays.networkdaysList business days, weekends and HolidaysIn[1]:fromnetworkdaysimportnetworkdaysIn[2]:importdatetimeIn[3]:HOLIDAYS={datetime.date(2020,12,25)}# define a Holidays list# initiate  class::`networkdays.Networkdays`In[4]:days=networkdays.Networkdays(datetime.date(2020,12,15),# start datedatetime.date(2020,12,31),# end dateHOLIDAYS# list of Holidays)In[5]:days.networkdays()# return a list os workdaysOut[5]:[datetime.date(2020,12,15),datetime.date(2020,12,16),datetime.date(2020,12,17),datetime.date(2020,12,18),datetime.date(2020,12,21),datetime.date(2020,12,22),datetime.date(2020,12,23),datetime.date(2020,12,24),datetime.date(2020,12,28),datetime.date(2020,12,29),datetime.date(2020,12,30),datetime.date(2020,12,31)]In[6]:days.weekends()# list os Weekends (default = Saturday ans Sunday)Out[6]:[datetime.date(2020,12,19),datetime.date(2020,12,20),datetime.date(2020,12,26),datetime.date(2020,12,27)]In[7]:days.holidays()Out[7]:[datetime.date(2020,12,25)]# list of holidaysclass Networkdays.jobschedule>>>fromnetworkdaysimportnetworkdays>>>importdatetime>>># Distribute the 600 hrs of effort, starting on december 1, 2020 working 8hrs per day.>>>jobschedule=networkdays.JobSchedule(600,8,datetime.date(2020,12,1),networkdays=None)>>>job_dates=jobschedule.job_workdays()>>>jobschedule.bussines_days54>>>jobschedule.total_daysdatetime.timedelta(days=73)>>>jobschedule.prj_starts'12/01/20'>>>jobschedule.prj_ends'02/12/21'>>>list(jobschedule.years())[2020,2021]>>>list(jobschedule.months())[12,1,2]>>>list(jobschedule.weeks())# ISO[49,50,51,52,53,1,2,3,4,5,6]>>>f'days:{list(jobschedule.days())[:2]}...{list(jobschedule.days())[-2:]}''days: [datetime.date(2020, 12, 1), datetime.date(2020, 12, 2)] ... [datetime.date(2021, 2, 11), datetime.date(2021, 2, 12)]'Other similar projectsWhen I start to code, I did check for some similar projects.I knew aboutpython-dateutil, a great project I use for years…
I’d like something more straightforward or simpler.After to publish the python-networkdays on PyPi
I found some others  8(workdays: A 5 years old project, looks the same asnetworkdaystimeboard: A more complex but powerful projectpython-dateutilis great, powerful but even more complex.python-bizdays: Quick simple and direct …I will try to keep this list updated…More on ..https://networkdays.readthedocs.io/index.htmlhttps://libraries.io/pypi/python-networkdays/sourcerank