A fast, regular-expression based library for parsing dates, plus support for ISO 8601 durations.
Project description
nr.parsing.date
A fast, regular-expression based library for parsing dates, plus support for ISO 8601 durations.
Requirements
- Python 3.6+
Supported Date & Time Formats
%Y
– 4 digit year%m
– 2 digit month%d
– 2 digit day%H
– 2 digit hour%M
– 2 digit minute%S
– 2 digit second%f
– arbitrary precision milliseconds%z
– timezone offset ([+-]\d\d:?\d\d
offset orZ
for UTC)
Built-in format collections
ISO_8601
(see ISO 8601 on Wikipedia)JAVA_OFFSET_DATETIME
(see OffsetDateTime class on the Java 8 API documentation)
Features
- Easily extensible to support more date/time format options
- Date/time formats can use an extended regex-style mode to mark format options as optional (e.g.
the two formats
%Y
and%Y-%m
can be expressed in a single regex-style format string as%Y(-%m)?
)
Quickstart
from nr.parsing.date import duration, ISO_8601
ISO_8601.parse('2021-04-21T10:13:00.124+0000')
duration.parse('P3Y6M4DT12H30M5S')
Copyright © 2020 Niklas Rosenstein
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
nr.parsing.date-1.0.0.tar.gz
(9.9 kB
view details)
Built Distribution
File details
Details for the file nr.parsing.date-1.0.0.tar.gz
.
File metadata
- Download URL: nr.parsing.date-1.0.0.tar.gz
- Upload date:
- Size: 9.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15f40d644bab8c6a81a6fb6b318e503531dddb16fb561b288efe68e04a7fbdee |
|
MD5 | 8d60167ba283ed6229f4a0d6b85a9783 |
|
BLAKE2b-256 | 968d34e034307b37fb5257eb010b365c3e4d57b5073b2ed702f6093a896b747c |
File details
Details for the file nr.parsing.date-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: nr.parsing.date-1.0.0-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17b96c06d7a5265fb9b757034231db811035733df13a7f20da380e9f8536519c |
|
MD5 | d7dc5b537734ff3d79154c3eef1a791f |
|
BLAKE2b-256 | 0f3d366c36b64e0ed502f93c71de6c4f2947fcc063ceec7b916a60a5e0496695 |