Skip to main content

Utilities for parsing iso8601 intervals and durations

Project description

A set of utilities for parsing and validating iso8601 durations and intervals.

from iso8601utils import parsers
parsers.interval('2016-08-01T23:10:59.111Z/2016-08-08T00:13:23.001Z')
(datetime.datetime(2016, 8, 1, 23, 10, 59, 111), datetime.datetime(2016, 8, 8, 0, 13, 23, 1))

parsers.duration('P3Y6M4DT12H30M5S')
datetime.timedelta(1279, 45005)

from iso8601utils import validators
validators.interval('1999-12-31T16:00:00.000Z/P5DT7H')
True
validators.interval('23P7DT5H')
False
validators.duration('P3Y6M4W7DT12H30M5S')
True
validators.duration('23P7DT5H')
False

This project currently only supports utc times.

Project details


Download files

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

Files for iso8601utils, version 0.0.1.dev4
Filename, size File type Python version Upload date Hashes
Filename, size iso8601utils-0.0.1.dev4-py2-none-any.whl (4.9 kB) File type Wheel Python version py2 Upload date Hashes View
Filename, size iso8601utils-0.0.1.dev4.tar.gz (4.3 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page