Python module to determine if a date/time is within a certain time period. https://pypi.org/project/timeperiod2/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Henning Jacobs c0cb051b84 v20.10.0 3 weeks ago
.gitignore add usage 5 years ago
LICENSE README and flake8 formatting 5 years ago
MANIFEST.in add classifieres 5 years ago
README.rst add usage 5 years ago
setup.py v20.10.0 3 weeks ago
timeperiod.py fix error message for out-of-range high value 9 months ago
tox.ini README and flake8 formatting 5 years ago

README.rst

===========
Time Period
===========

Python module for determining if a datetime is within a time
period.

Based on the `original TimePeriod module`_ written by Paul Boyd <boyd.paul2@gmail.com>.


Installation
============

.. code-block:: bash

$ sudo pip install timeperiod2

Usage
=====

.. code-block:: python

import datetime
import timeperiod
# will return True iff we have Monday, Tuesday or Thursday:
timeperiod.in_period('wd {mon tue thu}')
# will return True iff we have "office time"
timeperiod.in_period('wd {Mon-Fri} hr {9-17}', datetime.datetime.now())

License
=======

Released under the LGPL:

http://www.gnu.org/licenses/#LGPL

Also see the LICENSE file.

.. _original TimePeriod module: https://pypi.python.org/pypi/TimePeriod