python-calendar
Install
From PyPI
pip install python-calendar
From source
rm build/ python_calendar.egg-info dist -Rf
python3 setup.py bdist_wheel
pip3 install -I dist/python_calendar-*-py3-none-any.whl
How to use
from python_calendar import Calendar
from dateutil.parser import parse
date_from = parse('2023-08-23')
date_to = parse('2024-08-23')
calendar = Calendar.get(date_from, date_to)
'Nb days : %s' % len(calendar.days)
#Nb days : 366
'Nb weeks : %s' % len(calendar.weeks)
#Nb weeks : 53
'Nb days for the 18th week in 2024 : %s' % len(calendar.nodes['2024-W18'].days)
#Nb days for the 18th week in 2024 : 7
'Nb months : %s' % len(calendar.months)
#Nb months : 13
'Nb days for Feb 2024 : %s' % len(calendar.nodes['2024-02'].days)
#Nb days for Feb 2024 : 29
'Nb years : %s' % len(calendar.years)
#Nb years : 2
'Nb days in 2024 : %s' % len(calendar.nodes['2024'].days)
#Nb days in 2024 : 235
calendar.days[0]
# 2023-08-23
calendar.days[-1]
# 2024-08-22
for d in calendar.nodes['2024-W34'].days:
print(d.date)
# 2024-08-19 00:00:00
# 2024-08-20 00:00:00
# 2024-08-21 00:00:00
# 2024-08-22 00:00:00
Contributors
Anthony K GROSS
Copyright and license
Code and documentation copyright 2024. Code released under the MIT license.
Metadata
Release files for python-calendar 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| python_calendar-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for python_calendar-1.0.1-py3-none-any.whl |
Release files / python_calendar-1.0.1-py3-none-any.whl
| Download URL | python_calendar-1.0.1-py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
21deaea0bd0fc5def6f330209e0277fe9dbac32941ebe48ec069af4ffa15779d
|
|
BLAKE2b-256 checksum How to use checksums |
f526d0e637df9774a5a7d44ffbedef38fcd88f1bc38d4f553637a52e77c4b53e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.8
|
Security for python-calendar 1.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.