Skip to main content

Deltaman - Parsing human time intervals

pip install deltaman

Getting Started

from deltaman import delta_parser

for delta in ("15s", "3min", "1h15m", "1 day 12 hours", "1m-15s"):
    parsed = delta_parser.parse(delta)
    print(f'{delta!r:20s} {parsed!r:20s}')

That outputs

'15s'                datetime.timedelta(seconds=15)
'3min'               datetime.timedelta(seconds=180)
'1h15m'              datetime.timedelta(seconds=4500)
'1 day 12 hours'     datetime.timedelta(days=1, seconds=43200)
'1m-15s'             datetime.timedelta(seconds=45)

Note you can get more examples from the testing files.

Testing

$ pytest

Or

$ tox

Metadata

Release files for deltaman 0.0.4

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

Source distribution (sdist)

Source distribution for deltaman 0.0.4
File Size Uploaded
deltaman-0.0.4.tar.gz 27.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for deltaman 0.0.4
File Interpreter ABI Platform
deltaman-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 54.5 kB

Release files / deltaman-0.0.4.tar.gz

Download URL deltaman-0.0.4.tar.gz
Size 27.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0a2ec2f95bdef58f080d237fd10dd103ade5770d0955acbfd38616452eadc840
BLAKE2b-256 checksum
How to use checksums
647402648becdab039d8b03ab5ef8384f4714b81d7f969d54bb34e634c65c844
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.0 CPython/3.8.12 Linux/5.13.0-1031-azure

Release files / deltaman-0.0.4-py3-none-any.whl

Download URL deltaman-0.0.4-py3-none-any.whl
Size 27.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
627fdb72d610132e045353d0ccfcca06244845a44a733bc27a9cf3d5a37f5a26
BLAKE2b-256 checksum
How to use checksums
9acfc25a20ee1c81db633da02e7c194ff0304dd82d2f47f9dd164137ff98782e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.0 CPython/3.8.12 Linux/5.13.0-1031-azure

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files

0.0.2

2 release files

0.0.1

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