No project description provided
Project description
nano_duration: Operations with ISO 8601 durations.
What is this.
ISO 8601 is most commonly known as a way to exchange date-times in textual format. to have more precision duration this package included milliseconds, microseconds, and nanoseconds A lesser-known aspect of the standard is the representation of durations. They have a shape similar to this:
P3Y6M4DT12H30M5S80m90u120n
which symbols defined as blow:
"Y" -> "years"
"M" -> "months"
"D" -> "days"
"H" -> "hours"
"M" -> "minutes"
"S" -> "seconds"
"m" -> "miliseconds"
"u" -> "microseconds"
"n" -> "nanoseconds"
As this module maps ISO 8601 dates/times to standard Python data type.
Parse:
parses an ISO 8601 duration string into Duration object.
from nano_duration import parse
duration = parse("P3Y6M4DT12H24M12S10m80u12n")
Generate:
generate a duration object into ISO 8601 duration string
from nano_duration import Duration, generate
generate(
Duration(
{
"years": 3,
"months": 2,
"days": 3,
"hours": 5,
"seconds": 57,
"miliseconds": 8,
"microseconds": 30,
"nanoseconds": 20,
}
)
)
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
nano_duration-0.1.0.tar.gz
(3.8 kB
view hashes)
Built Distribution
Close
Hashes for nano_duration-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cbcdafabfdf0b2929570a0b0dc0f31cdebc5119d12e5024e6d6473320d97afb8 |
|
MD5 | 3f9eb1d7a711e5e4da8d04f2c5be56e3 |
|
BLAKE2b-256 | 6290833734253efa3e515c0348326dea29db1357df0ba67df68b4ee016cb63f8 |