Skip to main content

A representation of a duration of time

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

datetime-interval

[!WARNING] This project is archived and is no longer maintained. No further updates or releases will be made. For representing durations, intervals, or recurring events, we recommend using Python's built-in datetime.timedelta, or libraries like Pendulum or aniso8601.

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.

Source Distribution

datetime_interval-0.3.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

datetime_interval-0.3-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file datetime_interval-0.3.tar.gz.

File metadata

  • Download URL: datetime_interval-0.3.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for datetime_interval-0.3.tar.gz
Algorithm Hash digest
SHA256 6fce67a2af868e2f9c18f0d819abaacda8a37fe617ee8b84692ee3bf24314905
MD5 d6653f2504fde81e06994197237545a8
BLAKE2b-256 81d7298276b5054a7f6b1d6749e50272b6489ea4e29ad19049f145fe251ab36a

See more details on using hashes here.

File details

Details for the file datetime_interval-0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for datetime_interval-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0bb24f182eecd80c70c07c3dc30f7eb619ba436a2d04b898b2c1d76c35657d42
MD5 a38b4893302dfc4263d11b8998ca892c
BLAKE2b-256 8dfd0b10edc98d9703285bc4c4416a88d74bcf474d6825b09dbc3085f48c5825

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page