1
0
Fork
You've already forked python-timeperiod2
0
Python module to determine if a date/time is within a certain time period. https://pypi.org/project/timeperiod2/
Python 100%
2020年10月03日 15:42:12 +02:00
.gitignore add usage 2014年12月11日 12:52:40 +01:00
LICENSE README and flake8 formatting 2014年12月11日 11:16:57 +01:00
MANIFEST.in add classifieres 2014年12月11日 11:32:50 +01:00
README.rst add usage 2014年12月11日 12:52:40 +01:00
setup.py v20.10.0 2020年10月03日 15:42:12 +02:00
timeperiod.py fix error message for out-of-range high value 2020年01月20日 11:23:31 +01:00
tox.ini README and flake8 formatting 2014年12月11日 11:16:57 +01:00

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

 $ sudo pip install timeperiod2

Usage

 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.