A representation of a duration of time
Project description
The builtin datetime module provides classes for points in time (date, and datetime) as well as durations (timedelta), but it does not account for time durations at a specific point. This module provides Interval, which contains a start and end date or datetime, and a duration timedelta. This is useful for representing calendar events. This module also provides PeriodicInterval which can be used for recurring events, by containing a period timedelta and a count of occurrences (either an int or forever).
TODO:
Interval isoformat method (start/end).
This wouldn’t work on PeriodicInterval, as recurring intervals have a different semantics in ISO 8601.
Property-based testing with props
Add operators for PeriodicInterval (*, [])
How to account for e.g. every Tuesday and Thursday
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 Distribution
File details
Details for the file datetime-interval-0.2.tar.gz
.
File metadata
- Download URL: datetime-interval-0.2.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e98f62e64de8d7f963a13b6c8eacf495cb1b96f2ac98663c368fc50a7322c09b |
|
MD5 | 0d43381ba3269878fe4b51a0c5ac7555 |
|
BLAKE2b-256 | 3b0ffdffe5a06d09b9b3b9deac2686a30f89ef0367ece90809762c9379d982c5 |