ogt / workdays Goto Github PK
View Code? Open in Web Editor NEWExtend python datetime with excel-like workday addition/subtraction functionality
License: BSD 3-Clause "New" or "Revised" License
Extend python datetime with excel-like workday addition/subtraction functionality
License: BSD 3-Clause "New" or "Revised" License
Good afternoon,
Could you please publish a new release which provides the "weekends" parameter to workday and networkdays functions so that I can get it through pypi ?
Thank you very much,
Antoine,
Hello,
Sorry for my english but is not my native language...
in the "workday" function is that I can import dates from a file for "holidays"?
thanks
Neither the workday function nor the networkdays function de-duplicate the list of holidays. This can lead to workday reporting a date that is later than the correct date and networkdays reporting fewer days than the correct number of working days.
I'm still quite new to Python so there may be better/more efficient ways of fixing this, but adding the following line to each of the functions should resolve the issue:
holidays = list(dict.fromkeys(holidays))
Release 1.5 is not in PyPI so versions are stuck at 1.4 via pip
. Can be replicated by running:
pip install workdays==1.5
Which gives the expected error of:
Collecting workdays==1.5
Could not find a version that satisfies the requirement workdays==1.5 (from versions: 1.0, 1.2, 1.3, 1.4)
No matching distribution found for workdays==1.5
Could it include the holidays in Brazil?
Possibly add functionality to return the dates that are working days and then days that are weekend and holiday.
I want to use workdays in my project, but absence of license makes it hard from legal perspective.
Could you please change the "public domain" to BSD license or something like this?
What's the process for adding new countries, there's a public API to get all that information from.
Ref:
https://calendarific.com/holidays/2019/AR
https://calendarific.com/holidays/2019/AR
Hi there!
We use this workdays module in our application and were sad to see support for it end.
Would love to take it over and keep it up to date.
Thank you,
Vance
Calling workday for a Saturday with days=5 should return a Friday, instead it returns a Monday.
This line fails in my test file.
assert workday(date(2014, 2, 22), 5) == date(2014, 2, 28)
Here is the whole file, I use py.test.
from datetime import date
from workdays import workday
def test_monday():
assert workday(date(2014, 2, 17), 0) == date(2014, 2, 17)
assert workday(date(2014, 2, 17), 1) == date(2014, 2, 18)
assert workday(date(2014, 2, 17), 2) == date(2014, 2, 19)
assert workday(date(2014, 2, 17), 3) == date(2014, 2, 20)
assert workday(date(2014, 2, 17), 4) == date(2014, 2, 21)
assert workday(date(2014, 2, 17), 5) == date(2014, 2, 24)
assert workday(date(2014, 2, 17), 6) == date(2014, 2, 25)
def test_friday():
assert workday(date(2014, 2, 21), 0) == date(2014, 2, 21)
assert workday(date(2014, 2, 21), 1) == date(2014, 2, 24)
assert workday(date(2014, 2, 21), 2) == date(2014, 2, 25)
assert workday(date(2014, 2, 21), 3) == date(2014, 2, 26)
assert workday(date(2014, 2, 21), 4) == date(2014, 2, 27)
assert workday(date(2014, 2, 21), 5) == date(2014, 2, 28)
assert workday(date(2014, 2, 21), 6) == date(2014, 3, 3)
def test_saturday():
assert workday(date(2014, 2, 22), 0) == date(2014, 2, 24)
assert workday(date(2014, 2, 22), 1) == date(2014, 2, 24)
assert workday(date(2014, 2, 22), 2) == date(2014, 2, 25)
assert workday(date(2014, 2, 22), 3) == date(2014, 2, 26)
assert workday(date(2014, 2, 22), 4) == date(2014, 2, 27)
assert workday(date(2014, 2, 22), 5) == date(2014, 2, 28)
assert workday(date(2014, 2, 22), 6) == date(2014, 3, 3)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.