Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
datetime-interval-0.2.tar.gz (4.2 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page