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.

Source Distribution

iso8601utils-0.0.1.dev2.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

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

iso8601utils-0.0.1.dev2-py2-none-any.whl (4.8 kB view details)

Uploaded Python 2

File details

Details for the file iso8601utils-0.0.1.dev2.tar.gz.

File metadata

File hashes

Hashes for iso8601utils-0.0.1.dev2.tar.gz
Algorithm Hash digest
SHA256 9098521a131eb39858a302f487fbb750b1dcf5ee845376aa3e1dd594e001bd19
MD5 bd5eaf607f807ac45e64b7bddea9e583
BLAKE2b-256 4b5013459d2983a9091f88f51cbe4180fb607a0147f8de269759b265fb02a29b

See more details on using hashes here.

File details

Details for the file iso8601utils-0.0.1.dev2-py2-none-any.whl.

File metadata

File hashes

Hashes for iso8601utils-0.0.1.dev2-py2-none-any.whl
Algorithm Hash digest
SHA256 cb478d4452d9422877e60c04e1675207a0daca12736ce77ddc4e9c25cb450dcc
MD5 dfb7814c422f0ab18cc79bbf507d6016
BLAKE2b-256 5beb28cc7464ebe1eded134f6bd130606c5db9dc3d13b0e0267c1b1b06601334

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