calendary
Python calendar and datetime helpers.
Free software: BSD license
Documentation: https://calendary.readthedocs.io.
Features
Return a list of days for any year
cal = Calendary(2016)
weekdays = cal.weekday_calendar()
today = datetime.datetime.now().date()
for weekday, date in weekdays:
if date < today:
print("{0}-{1}-{2} was a {3}".format(date.month, date.day, date.year, weekday))
elif date == today:
print("Today is {}".format(weekday))
else:
print("{0}-{1}-{2} will be a {3}".format(date.month, date.day, date.year, weekday))
Return a list of only workdays (default: Monday-Friday)
cal = Calendary(2016)
workdays = cal.workday_calendar()
for weekday, date in workdays:
print(weekday, date)
Change the workweek begin and end
cal = Calendary(2016)
# Work Tuesday - Saturday
workdays = cal.workday_calendar(workweek_start=1, workweek_end=5)
Get the calendar for a specific month
cal = Calendary(2016)
# July calendar
cal.month(7)
# July workweek calendar
cal.month(7, work=True, workweek_start=1, workweek_end=5)
Get a specific date relative to the calendar
cal = Calendary(2016)
# Get the third Thursday in July of 2016
cal.weekday('Thursday', month=7, ordinal=3)
# Get all Thursdays in July 2016
cal.weekday('Thursday', month=7)
# Get the third Thursday in 2016
cal.weekday('Thursday', ordinal=3)
# Get all Thursdays in 2016
cal.weekday('Thursday')
# Get all Mondays and Thursdays in July, 2016 using weekday index values
cal.weekday((0, 3), month=7)
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
0.1.0 (2016-07-20)
First release on PyPI.
Metadata
Release files for calendary 0.3.13
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 |
|---|---|---|---|---|
| calendary-0.3.13.tar.gz | 14.8 kB | Without provenance | Details for calendary-0.3.13.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| calendary-0.3.13-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for calendary-0.3.13-py2.py3-none-any.whl |
Total release size: 20.4 kB
Release files / calendary-0.3.13.tar.gz
| Download URL | calendary-0.3.13.tar.gz |
|---|---|
| Size | 14.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6abc030c08f37e3f8fdb3aebcf45759419ed44994d322e2648f17f8ae98812a6
|
|
BLAKE2b-256 checksum How to use checksums |
d1c379e710b14cfeeaaa44f4cd527caa9822fd6d162da7a94a9de48e14be1e65
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / calendary-0.3.13-py2.py3-none-any.whl
| Download URL | calendary-0.3.13-py2.py3-none-any.whl |
|---|---|
| Size | 5.6 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
05251c5970d5b0e5342df2687d8be8fd8a7c5d2a431fac7515ce6a27845fc4b2
|
|
BLAKE2b-256 checksum How to use checksums |
23bd1022c1ce304d0527441bbc1ea3c85f95bc6d7d319b687ce2b3221335d9e3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for calendary 0.3.13
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.