Holidays and working days calculations
Project description
Workingless is a lib for holidays calculations. Currently it supports Colombia and Mexico (beta) holidays.
Usage
Workingless has four methods for the countries supported, they are: get_holidays_from_year, is_holiday, is_working_day and get_next_working_day.
Example usage:
import datetime
from workingless import countries
colombia = countries.COL()
holidays = colombia.get_holidays_from_year(year=2020)
print(type(holidays)) # <class 'generator'>
print(list(holidays))
# result:
# [
# datetime.date(2020, 1, 1),
# datetime.date(2020, 1, 6),
# datetime.date(2020, 3, 23),
# datetime.date(2020, 4, 5),
# datetime.date(2020, 4, 9),
# datetime.date(2020, 4, 10),
# datetime.date(2020, 4, 12),
# datetime.date(2020, 5, 1),
# datetime.date(2020, 5, 25),
# datetime.date(2020, 6, 15),
# datetime.date(2020, 6, 22),
# datetime.date(2020, 6, 29),
# datetime.date(2020, 7, 20),
# datetime.date(2020, 8, 7),
# datetime.date(2020, 8, 17),
# datetime.date(2020, 10, 12),
# datetime.date(2020, 11, 2),
# datetime.date(2020, 11, 16),
# datetime.date(2020, 12, 8),
# datetime.date(2020, 12, 25)
# ]
colombia.is_holiday(date=datetime.date(2020, 1, 1)) # True
colombia.is_working_day(datetime.date(2020, 1, 1) # False
colombia.get_next_working_day(datetime.date(2020, 1, 1) # datetime.date(2020, 1, 2)
License
Distributed under the terms of the GPLv3 license.
See license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
workingless-0.2.1.tar.gz
(8.7 kB
view details)
Built Distribution
File details
Details for the file workingless-0.2.1.tar.gz
.
File metadata
- Download URL: workingless-0.2.1.tar.gz
- Upload date:
- Size: 8.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a2f925bd1d5ad89d1be3f2d10de0531aebd617521b64a4df49fd610a6d53844 |
|
MD5 | 1f0b6ebecfd4f5ed0d1b831a69b41599 |
|
BLAKE2b-256 | dfdd9796eec69a63c6ad3afad9c8c1fe3c694345fe4174d2ff5f2e2fa7958b83 |
File details
Details for the file workingless-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: workingless-0.2.1-py3-none-any.whl
- Upload date:
- Size: 29.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1fb6d221d8df3a1e944b5c9bc9a3ecc9d41632a9518965c9c4873aeeb320a08 |
|
MD5 | 95ba675130563e8bdf02c757204ae089 |
|
BLAKE2b-256 | 68fad4376bc369c966ae24e236ae474f81283d025f2171b02e90939cd5cf4e54 |