Skip to main content

RegDurations

This library allows to simply parse durations written in a string, in multiple supported languages.

Install

Run:

pip install regdurations

Usage

from regdurations import DurationParser

duration_parser = DurationParser()
# optionally specify a list of supported languages:
duration_parser = DurationParser(allowed_languages=['it', 'en'])

duration_parser.find_relativedelta('3 weeks 10y 4 anni 5 minuti')
>>> (relativedelta(years=+14, days=+21, minutes=+5), 0, 27)  # result, starting index, ending index
# or, if dateutil is not installed:
duration_parser.find_dict('4s 23gg 78 settimane')
>>> ({'seconds': 4, 'minutes': 0, 'hours': 0, 'days': 23, 'weeks': 78, 'months': 0, 'years': 0}, 0, 20)

Supported Languages

  • EN, IT, FR, DE, ES
  • Contributions for new languages are accepted

Credits and contact

  • Thanks to CalledLuca for the idea and the FR, DE, ES languages!
  • For any question you can try to contact me on Telegram.

License

This project is licensed under the Boost Software License. Please take a look.

Metadata

Release files for regdurations 1.0.8

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

Source distribution (sdist)

Source distribution for regdurations 1.0.8
File Size Uploaded Provenance Actions
regdurations-1.0.8.tar.gz 4.8 kB Without provenance Details for regdurations-1.0.8.tar.gz

Built distribution (wheel)

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

Total release size: 10.4 kB

Release files / regdurations-1.0.8.tar.gz

Download URL regdurations-1.0.8.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
ae4aa801a5ebad36204ac4875a464b47320abfd3d0552f974a1c0846940b5fdd
BLAKE2b-256 checksum
How to use checksums
ecf545e7a7fb71d918ab1f36d5d2048e922c1681213d46195f09ee6b259e0de3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / regdurations-1.0.8-py3-none-any.whl

Download URL regdurations-1.0.8-py3-none-any.whl
Size 5.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0dd20d606f5ba39fc366835ad23bec9f8d9d5c40544a021b0edef989b6735c22
BLAKE2b-256 checksum
How to use checksums
de69b69a5a3971c2ea415174c7815a0a064826c3d74437f09632d0f5b7979bf4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Security for regdurations 1.0.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.8 This release

2 release files No provenance

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