canada-holiday
a Python package for retrieving Canadian holidays information for all provinces for any given year.
Installation
With pip:
pip install canada-holiday
With poetry:
poetry add canada-holiday
Usage
import datetime
import canada_holiday
on_holidays_2023 = canada_holiday.get_holidays("Ontario", 2023)
# prints "Getting holiday information of Ontario province..."
print(on_holidays_2023)
# [CanadaHoliday(New Year's Day, 2023-01-01, Sunday, all), CanadaHoliday(Family Day, 2023-02-20, Monday, Ontario), ...]
manitoba_holidays_2023_june = canada_holiday.get_holidays("MB", 2023, 2)
# prints "Getting holiday information of Manitoba province..."
print(manitoba_holidays_2023_june)
# [CanadaHoliday(Louis Riel Day, 2023-02-20, Monday, Manitoba)]
louis_riel_day = manitoba_holidays_2023_june[0]
print(louis_riel_day.name)
# Louis Riel Day
print(louis_riel_day.month)
# 2
print(louis_riel_day.day)
# 20
print(louis_riel_day.date)
# 2023-02-20
print(louis_riel_day.province)
# Manitoba
print(louis_riel_day.day_of_the_week)
# Monday
date = datetime.date(2023, 8, 7)
result = canada_holiday.is_holiday(date, "British Columbia")
# prints "2023-08-07 is a holiday, B.C. Day in British Columbia province(s) in Canada"
print(result)
# True
date = datetime.date(2023, 4, 5)
result = canada_holiday.is_holiday(date, "Nova Scotia")
# prints "2023-04-05 is not a holiday in Nova Scotia province."
print(result)
# False
Metadata
Release files for canada-holiday 1.2.0
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 |
|---|---|---|---|---|
| canada_holiday-1.2.0.tar.gz | 8.2 kB | Without provenance | Details for canada_holiday-1.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| canada_holiday-1.2.0-py3-none-any.whl | Python 3 | none | any | Details for canada_holiday-1.2.0-py3-none-any.whl |
Total release size: 22.2 kB
Release files / canada_holiday-1.2.0.tar.gz
| Download URL | canada_holiday-1.2.0.tar.gz |
|---|---|
| Size | 8.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
add12d65d3f76164d3e89c414510c7db91a5d684864f742f3d8026580cc4438b
|
|
BLAKE2b-256 checksum How to use checksums |
98245602ad6d3f50978a060b1456d5eaee7c29cb58d2b201e3e3592d29f2f053
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.8.12 Linux/5.4.0-200-generic
|
Release files / canada_holiday-1.2.0-py3-none-any.whl
| Download URL | canada_holiday-1.2.0-py3-none-any.whl |
|---|---|
| Size | 13.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d89631f3e9f3320d001d18d8a778c0928084df62571b1f945c6bcca81553e758
|
|
BLAKE2b-256 checksum How to use checksums |
8c737d2097917c6561a58878423c1e96c5a95e93a55b3b66a46db09cf89918db
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.8.12 Linux/5.4.0-200-generic
|
Security for canada-holiday 1.2.0
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.