This package let you perform simple date arithmetics on standard datetime.date objects taking into account working days (weekend, holidays).
Python compatibility
The package is continuosly tested on Python 2.7, 3.2, 3.3 and 3.4.
Requirements
Pros
The API is simple and clear and the implementation is straightforward.
Localization - that is handling holidays for different countries - is built-in and easy to extend.
Cons
The implementation is not very optimized and it is expected to be used for small date deltas.
Currently only italian holidays are implemented, but feel free to send pull requests for your country of interest.
Examples:
Check if a date is a working day
import date import workingdays is_today_working = workingdays.is_workingday(date.today())
Add a number of working days to a certain date
import date import workingdays two_workingdays_from_today = workingdays.add(date.today(), 2)
Count the number of working days between two dates
import date import workingdays workingdays_between_dates = workingdays.diff(date(2015, 3, 27), date(2015, 3, 25))
Compute the next working day starting from a certain date
import date import workingdays workingday_after_today = workingdays.next(date.today())
Use a different localization, that is taking into account holidays for a particular country
import date import workingdays import workingdays.l10n.it workingdays.is_workingday = workingdays.l10n.it.is_workingday workingday_after_today_in_italy = workingdays.next(date.today())
See file test.py in the source directory to have a better idea of the API and the expected results.
Metadata
Release files for pyworkingdays 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyworkingdays-0.1.tar.gz | 1.8 kB | Without provenance | Details for pyworkingdays-0.1.tar.gz |
Release files / pyworkingdays-0.1.tar.gz
| Download URL | pyworkingdays-0.1.tar.gz |
|---|---|
| Size | 1.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
20c53d9519d477e816c617317a673ae79cf7c6367732bb82ce300801f3bc55af
|
|
BLAKE2b-256 checksum How to use checksums |
10b609e7bcd27690326cc0b7dc9bd081b7bd6f78b32797d6a81e57bcd7f8b0bb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for pyworkingdays 0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.