Skip to main content

Python package to format duration

Project description

Downloads

format_duration

Python module to convert duration to human readable format

Installation

pip install format_duration

Usage

from datetime import timedelta
from format_duration import DurationLimit, format_duration

duration = timedelta(days=1, hours=1, minutes=1, seconds=1)  # duration to format
limit = DurationLimit.MINUTE  # only print till minutes
is_abbreviated = False  # Whether to print in abbreviated form
formatted_duration = format_duration(duration, is_abbreviated, limit)  # formatted duration string
print(formatted_duration)  # 1 days, 1 hours, 1 minutes 

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

format_duration-0.0.5.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

format_duration-0.0.5-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file format_duration-0.0.5.tar.gz.

File metadata

  • Download URL: format_duration-0.0.5.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.1

File hashes

Hashes for format_duration-0.0.5.tar.gz
Algorithm Hash digest
SHA256 c5b99fb28e819cff2b96738ebd2569bed4fa317008c700cdf083d9c858eec048
MD5 d393123cf32a3dc71309e46cef1b14ac
BLAKE2b-256 579865c2c76ff091255360d6b733217d3e66be8ff24200c3f5a3b6f6f0d65a10

See more details on using hashes here.

File details

Details for the file format_duration-0.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for format_duration-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 0699418eff4f3bc8df8df9ece5c4485d43916d79d01b1f43bbf4d6e0dbf7344c
MD5 6892a5e81fa6a599ac950a0e629596e8
BLAKE2b-256 353e265bdeea2940a4ecfadfc1556dffca052c561c670efbc5107bcd061be742

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page