Generate and parse RFC 3339 timestamps
Project description
Description
pyRFC3339 parses and generates RFC 3339-compliant timestamps using Python datetime.datetime objects.
>>> from pyrfc3339 import generate, parse
>>> from datetime import datetime, timezone
>>> generate(datetime.now(timezone.utc)) #doctest:+ELLIPSIS
'...T...Z'
>>> parse('2009-01-01T10:01:02Z')
datetime.datetime(2009, 1, 1, 10, 1, 2, tzinfo=datetime.timezone.utc)
>>> parse('2009-01-01T14:01:02-04:00')
datetime.datetime(2009, 1, 1, 14, 1, 2, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=72000)))
Installation
To install the latest version from PyPI:
$ pip install pyRFC3339
To install the latest development version:
$ pip install https://github.com/kurtraschke/pyRFC3339/tarball/main#egg=pyRFC3339-dev
Tests as well as enforcement of code style, formatting, and type safety are run with tox:
$ tox
To build the documentation with Sphinx:
$ tox -e docs
The documentation is also available online at:
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyrfc3339-2.1.0.tar.gz.
File metadata
- Download URL: pyrfc3339-2.1.0.tar.gz
- Upload date:
- Size: 12.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c569a9714faf115cdb20b51e830e798c1f4de8dabb07f6ff25d221b5d09d8d7f
|
|
| MD5 |
b2bd788bc06e60802042f52085943683
|
|
| BLAKE2b-256 |
b47f3c194647ecb80ada6937c38a162ab3edba85a8b6a58fa2919405f4de2509
|
Provenance
The following attestation bundles were made for pyrfc3339-2.1.0.tar.gz:
Publisher:
python.yml on kurtraschke/pyRFC3339
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyrfc3339-2.1.0.tar.gz -
Subject digest:
c569a9714faf115cdb20b51e830e798c1f4de8dabb07f6ff25d221b5d09d8d7f - Sigstore transparency entry: 426079155
- Sigstore integration time:
-
Permalink:
kurtraschke/pyRFC3339@ff6ec789381717903a84912ea7b6fa527b0d0deb -
Branch / Tag:
refs/tags/v2.1.0 - Owner: https://github.com/kurtraschke
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python.yml@ff6ec789381717903a84912ea7b6fa527b0d0deb -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyrfc3339-2.1.0-py3-none-any.whl.
File metadata
- Download URL: pyrfc3339-2.1.0-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
560f3f972e339f579513fe1396974352fd575ef27caff160a38b312252fcddf3
|
|
| MD5 |
39e6dedfb97c7af2d376f2387075e956
|
|
| BLAKE2b-256 |
34900200184d2124484f918054751ef997ed6409cb05b7e8dcbf5a22da4c4748
|
Provenance
The following attestation bundles were made for pyrfc3339-2.1.0-py3-none-any.whl:
Publisher:
python.yml on kurtraschke/pyRFC3339
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyrfc3339-2.1.0-py3-none-any.whl -
Subject digest:
560f3f972e339f579513fe1396974352fd575ef27caff160a38b312252fcddf3 - Sigstore transparency entry: 426079175
- Sigstore integration time:
-
Permalink:
kurtraschke/pyRFC3339@ff6ec789381717903a84912ea7b6fa527b0d0deb -
Branch / Tag:
refs/tags/v2.1.0 - Owner: https://github.com/kurtraschke
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python.yml@ff6ec789381717903a84912ea7b6fa527b0d0deb -
Trigger Event:
push
-
Statement type: