Skip to main content

jetblack-iso8601

Support for ISO8601 (read the docs).

Usage

Timestamps

Timestamps can be parsed with iso8601_to_datetime and converted to a string with datetime_to_iso8601.

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.

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

Metadata

Release files for jetblack-iso8601 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jetblack-iso8601 2.0.0
File Size Uploaded
jetblack_iso8601-2.0.0.tar.gz 9.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for jetblack-iso8601 2.0.0
File Interpreter ABI Platform
jetblack_iso8601-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 17.8 kB

Release files / jetblack_iso8601-2.0.0.tar.gz

Download URL jetblack_iso8601-2.0.0.tar.gz
Size 9.0 kB
Tags Source
SHA-256 checksum
How to use checksums
9360a726958941f4a0ed1c2c8e8d9da852c09b056adb1d7f7ca04aecd6d667f6
BLAKE2b-256 checksum
How to use checksums
85d32be5be70859efb957ef53fff85023358771569139e64d74b4a3fb4de312f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.20

Release files / jetblack_iso8601-2.0.0-py3-none-any.whl

Download URL jetblack_iso8601-2.0.0-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b0dd331f24f96e35235c47dd604f97a74e86204f47517f21c07045f062921d41
BLAKE2b-256 checksum
How to use checksums
d50b464c78ebd889ca921ea0591cbbc66a6e1dc62dc03a02b6d5f3487d5d47f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.20

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page