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.
=======================
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for iso8601utils-0.0.1.dev3-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9617156cd715ccd67f5c304ab0e14cade37852b3ebc95d36aa3d8433910e949 |
|
MD5 | 87b108b5636c8488defce505e8ce1784 |
|
BLAKE2b-256 | bb6b5efb453b430ed577dd85ee6058ffa447dcb0c7cc09c5c5cce582ad2aba7a |