Code Monkey home page Code Monkey logo

workdays's People

Contributors

berczisandor avatar billendow avatar mgarabed avatar ogt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

workdays's Issues

Publish a new release with weekends parameter

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,

workday function

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

De-duplicate list of holidays

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))

1.5 is not released to PyPI.

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

BSD license

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?

Interested In Taking Over Project

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

Wrong answer for workday(<Saturday>, 5)

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.