Skip to main content

Utilities for parsing iso8601 intervals and durations

Project description

iso8601utils
=======================

A set of utilities for parsing and validating iso8601 `durations
<https://en.wikipedia.org/wiki/ISO_8601#Durations>`_ and `intervals
<https://en.wikipedia.org/wiki/ISO_8601#Time_intervals>`_.

.. code:: python
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.dev3.tar.gz (4.3 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.dev3-py2-none-any.whl (4.9 kB view details)

Uploaded Python 2

File details

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

File metadata

File hashes

Hashes for iso8601utils-0.0.1.dev3.tar.gz
Algorithm Hash digest
SHA256 efdf4810c714387fb6cf6ec3938e6c42dd83a040964ffa3e312c0f8ef13e92d4
MD5 58cce40f8bfc307f9a53175b94c3b0f3
BLAKE2b-256 698356422226ca34e6da226b5e1bf64cc8d5d9fc87a31cc9113420894885c039

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for iso8601utils-0.0.1.dev3-py2-none-any.whl
Algorithm Hash digest
SHA256 f9617156cd715ccd67f5c304ab0e14cade37852b3ebc95d36aa3d8433910e949
MD5 87b108b5636c8488defce505e8ce1784
BLAKE2b-256 bb6b5efb453b430ed577dd85ee6058ffa447dcb0c7cc09c5c5cce582ad2aba7a

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