
Security News
pnpm 10.16 Adds New Setting for Delayed Dependency Updates
pnpm's new minimumReleaseAge setting delays package updates to prevent supply chain attacks, with other tools like Taze and NCU following suit.
.. image:: https://img.shields.io/pypi/v/calendary.svg :target: https://pypi.python.org/pypi/calendary
.. image:: https://travis-ci.org/DavidHickman/calendary.svg?branch=master :target: https://travis-ci.org/DavidHickman/calendary
.. image:: https://readthedocs.org/projects/calendary/badge/?version=latest :target: https://calendary.readthedocs.io/en/latest/?badge=latest :alt: Documentation Status
.. image:: https://pyup.io/repos/github/davidhickman/calendary/shield.svg :target: https://pyup.io/repos/github/davidhickman/calendary/ :alt: Updates
.. image:: https://pyup.io/repos/github/davidhickman/calendary/python-3-shield.svg :target: https://pyup.io/repos/github/davidhickman/calendary/ :alt: Python 3
Python calendar and datetime helpers.
Return a list of days for any year
.. code-block:: python
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)
.. code-block:: python
cal = Calendary(2016)
workdays = cal.workday_calendar()
for weekday, date in workdays:
print(weekday, date)
Change the workweek begin and end
.. code-block:: python
cal = Calendary(2016)
# Work Tuesday - Saturday
workdays = cal.workday_calendar(workweek_start=1, workweek_end=5)
Get the calendar for a specific month
.. code-block:: python
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
.. code-block:: python
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)
This package was created with Cookiecutter_ and the audreyr/cookiecutter-pypackage
_ project template.
.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _audreyr/cookiecutter-pypackage
: https://github.com/audreyr/cookiecutter-pypackage
FAQs
Python calendar helper.
We found that calendary demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
pnpm's new minimumReleaseAge setting delays package updates to prevent supply chain attacks, with other tools like Taze and NCU following suit.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.