Skip to main content

returns the number of seconds as the approx. largest unit of time.

Project description

Fuzzy Duration

A simple package to convert a number of seconds to the approximate duration of the largest time unit.

install

python3 -m pip install fuzzyduration --user

Usage

from fuzzyduration import fuzzyDuration

secs = 60 * 60 * 24 * 1 + 1234

result = fuzzyDuration(secs)

print(result) # "1 day"

secs = secs * 8 * 2

print(result) # "2 weeks"

secs = secs * 60

print(result) # "2 years"

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

fuzzyduration-0.2.0.tar.gz (1.7 kB view hashes)

Uploaded Source

Built Distribution

fuzzyduration-0.2.0-py3-none-any.whl (1.8 kB view hashes)

Uploaded Python 3

Supported by

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