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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2069c4e717e5b967b1d71f3cc317decbe78a3547812548ff800b537c051be88 |
|
MD5 | dbcbfd4489ac4ab2ffada6c0ac471e0d |
|
BLAKE2b-256 | 09b86158e670aa165424b53291641bc4a3e69e41fb17ba5d276016892f13c090 |
File details
Details for the file simple_notifs-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: simple_notifs-0.0.1-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0650af779c950637c01058170b45ac5c5457840f15a1be6d85467ea0ea22ef6 |
|
MD5 | b25164a156de483a06477935fe2d3576 |
|
BLAKE2b-256 | 697011973737a8470e593dda07254586ba541186e0e1dc28775fd8ff2617ec1d |