Python module for determining if a datetime is within a time period
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file timeperiod2-20.10.0-py3-none-any.whl
.
File metadata
- Download URL: timeperiod2-20.10.0-py3-none-any.whl
- Upload date:
- Size: 14.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: Python-urllib/3.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9cc4c8ec3f1971c7de8fcd44223805b38e2025deccbb9f49f62999a2eaff74d |
|
MD5 | 37bed47fc8c017f91e23a695398ab98b |
|
BLAKE2b-256 | 12919919e354700912e5b976e1612e114859db23280c5b8632b3627e81f2a77c |