Skip to main content

A python library for creating simple, shortened notification time deltas. This is specifically helpful when time differences like `1h` or `2w` are needed to show a how long something has existed as of right now.

Project description

Introduction

This library was built for making simple, shortened human readable versions of time deltas. This was specifically made for notifications on applications where a user wants to see how long it has been since the notification was made. For example, instead of a time delta such as "1 hour ago" or "20 minutes ago", the resulting time delta would be "1h" and "20mi", respectively

Access

From simple_notifs.simple_notifs import utc_to_human

Arguments

  • Mandatory, a datetime object must be passed as input to the function.
  • By default, is_utc is set to True. If false, the built in method converts the datetime object to utc, then performs its operation.
  • By default, days_and_above is set to False. If True, the built in method will only display time deltas starting at "1d". This means any deltas in seconds, minutes, or hours that are less than a full day, will be truncated to "1d".

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

simple_notifs-0.0.3.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

simple_notifs-0.0.3-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file simple_notifs-0.0.3.tar.gz.

File metadata

  • Download URL: simple_notifs-0.0.3.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for simple_notifs-0.0.3.tar.gz
Algorithm Hash digest
SHA256 dcb3e5a0aa0b01a3d2b74193dacd6f5e802d8c622c452d1faabcec9741bf6fdc
MD5 beed645fd2f0738fcf4d723841e92986
BLAKE2b-256 b9121a0ab9cfb135f5376faaf24fcf927c783d4bee70a0d0fd119cb869c7f143

See more details on using hashes here.

File details

Details for the file simple_notifs-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for simple_notifs-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d8d8803da449631581b2b0b887d3f5b50a29e7b968e49787a95b1f419312e714
MD5 f317d23b8386b548e827fb601c706b68
BLAKE2b-256 a9fcd61098a18fabcd09d6b1d678ddd1e385b2c4434a7125c921c4c0e4ce2139

See more details on using hashes here.

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