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 notificationon applications where a user wants to see how long it has been since the notification was made. Instead of "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.1.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: simple_notifs-0.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 a2069c4e717e5b967b1d71f3cc317decbe78a3547812548ff800b537c051be88
MD5 dbcbfd4489ac4ab2ffada6c0ac471e0d
BLAKE2b-256 09b86158e670aa165424b53291641bc4a3e69e41fb17ba5d276016892f13c090

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for simple_notifs-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f0650af779c950637c01058170b45ac5c5457840f15a1be6d85467ea0ea22ef6
MD5 b25164a156de483a06477935fe2d3576
BLAKE2b-256 697011973737a8470e593dda07254586ba541186e0e1dc28775fd8ff2617ec1d

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