# jetblack-iso8601
Support for ISO8601
(read the [docs](https://rob-blackbourn.github.io/jetblack-iso8601/)).
## Usage
### Timestamps
Timestamps can be parsed with `iso8601_to_datetime` and
converted to a string with `datetime_to_iso8601`.
```python
from jetblack_iso8601 import (
iso8601_to_datetime,
datetime_to_iso8601
)
text = '2014-02-01T09:28:56.321-10:00'
timestamp = iso8601_to_datetime(text)
roundtrip = datetime_to_iso8601(timestamp)
assert text == roundtrip
```
### Durations
Timestamps can be parsed with `iso8601_to_timedelta` and
converted to a string with `datetime_to_iso8601`.
```python
from jetblack_iso8601 import (
iso8601_to_timedelta,
timedelta_to_iso8601
)
text = 'P3Y2M1DT12H11M10S'
value = iso8601_to_timedelta(text)
roundtrip = timedelta_to_iso8601(value)
assert roundtrip == text
```
Raw data
{
"_id": null,
"home_page": "https://github.com/rob-blackbourn/jetblack-iso8601",
"name": "jetblack-iso8601",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7,<4.0",
"maintainer_email": "",
"keywords": "iso8601,jetblack",
"author": "Rob Blackbourn",
"author_email": "rob.blackbourn@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/60/19/56810f6dc939c4a755d9c0b2047a3ddd40d3c1e78856e86958529c4dfef2/jetblack-iso8601-1.0.2.tar.gz",
"platform": null,
"description": "# jetblack-iso8601\n\nSupport for ISO8601\n(read the [docs](https://rob-blackbourn.github.io/jetblack-iso8601/)).\n\n## Usage\n\n### Timestamps\n\nTimestamps can be parsed with `iso8601_to_datetime` and\nconverted to a string with `datetime_to_iso8601`.\n\n```python\nfrom jetblack_iso8601 import (\n iso8601_to_datetime,\n datetime_to_iso8601\n)\n\ntext = '2014-02-01T09:28:56.321-10:00'\ntimestamp = iso8601_to_datetime(text)\nroundtrip = datetime_to_iso8601(timestamp)\nassert text == roundtrip\n```\n\n### Durations\n\nTimestamps can be parsed with `iso8601_to_timedelta` and\nconverted to a string with `datetime_to_iso8601`.\n\n\n```python\nfrom jetblack_iso8601 import (\n iso8601_to_timedelta,\n timedelta_to_iso8601\n)\n\ntext = 'P3Y2M1DT12H11M10S'\nvalue = iso8601_to_timedelta(text)\nroundtrip = timedelta_to_iso8601(value)\nassert roundtrip == text\n```\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "ISO 8601 support",
"version": "1.0.2",
"project_urls": {
"Homepage": "https://github.com/rob-blackbourn/jetblack-iso8601",
"Repository": "https://github.com/rob-blackbourn/jetblack-iso8601"
},
"split_keywords": [
"iso8601",
"jetblack"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d931ac64c721b61f21b7acc351f302b3d17456fb4e8f70e20fdc50112be681c8",
"md5": "c0e8633050e7f3b084575d1fbbcf3b3c",
"sha256": "c5f71593f9b9f8f900ccd17a63b535fb17186ffc6d72f8249cb292e63c8fbd2f"
},
"downloads": -1,
"filename": "jetblack_iso8601-1.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c0e8633050e7f3b084575d1fbbcf3b3c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7,<4.0",
"size": 8310,
"upload_time": "2022-09-05T17:23:10",
"upload_time_iso_8601": "2022-09-05T17:23:10.907627Z",
"url": "https://files.pythonhosted.org/packages/d9/31/ac64c721b61f21b7acc351f302b3d17456fb4e8f70e20fdc50112be681c8/jetblack_iso8601-1.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "601956810f6dc939c4a755d9c0b2047a3ddd40d3c1e78856e86958529c4dfef2",
"md5": "69f72cb887e25506109238af821b3eec",
"sha256": "919e3703163254f2195f2132088dac0b77b637629ae597cf20c1eb70b0d727e6"
},
"downloads": -1,
"filename": "jetblack-iso8601-1.0.2.tar.gz",
"has_sig": false,
"md5_digest": "69f72cb887e25506109238af821b3eec",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7,<4.0",
"size": 7602,
"upload_time": "2022-09-05T17:23:08",
"upload_time_iso_8601": "2022-09-05T17:23:08.169572Z",
"url": "https://files.pythonhosted.org/packages/60/19/56810f6dc939c4a755d9c0b2047a3ddd40d3c1e78856e86958529c4dfef2/jetblack-iso8601-1.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-09-05 17:23:08",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "rob-blackbourn",
"github_project": "jetblack-iso8601",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "jetblack-iso8601"
}