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.2.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

simple_notifs-0.0.2-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: simple_notifs-0.0.2.tar.gz
  • Upload date:
  • Size: 4.2 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.2.tar.gz
Algorithm Hash digest
SHA256 0f416142444b5f405ce7b764a7e11760f92ed2cfef5fbe1600af33c8b217824d
MD5 4f61336a4e049185d4a97e3e11d94146
BLAKE2b-256 56ac47e07883c63923c85621542eadb50815976d7da7e9038ab901e0c0034c19

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for simple_notifs-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4a0d992695e039df27b4b3b8c54fd163efa55926d7a99bec548c67dbc7cb5877
MD5 597f4f8cda00746529a420f8fa8f9415
BLAKE2b-256 1ff96cdc882aa9128a530b7e04798dfdd6b64fd5bf2c9b6530d4a3acd849426a

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