python-utilz
Set of handy python utilities.
Installation
pip install python-utilz
Contents
- Get size of an object
- Convert exception to string
- Check UUID corrects without casting
- Human-readable time
- Human-readable size
- Separate digits
- Now
- Config from env
Get size of an object
Returns total size in bytes (when you do not want full-fledged library for this).
import python_utilz as pu
print(pu.get_size([1, 2, 3]))
# 172
Convert exception to string
Show more info than just str(exc).
import python_utilz as pu
print(repr(pu.exc_to_str(TimeoutError('test'))))
# 'TimeoutError: test'
Check UUID is correct without casting
When you want to check UUID, but do not want try-except on UUID(value).
import python_utilz as pu
print(pu.is_valid_uuid('lol-kek'))
# False
Human-readable time
Created to display difference between two timestamps.
import python_utilz as pu
print(repr(pu.human_readable_time(9999999)))
# '16w 3d 17h 46m 39s'
print(repr(pu.htime(1742579085.0 - 1741924401.0)))
# '1w 13h 51m 24s'
Human-readable size
Created to display total amount of bytes in something.
import python_utilz as pu
print(repr(pu.human_readable_size(999999999)))
# '953.7 MiB'
print(repr(pu.hsize(10000000000)))
# '9.3 GiB'
Separate digits
When you want number to be more readable.
import python_utilz as pu
print(repr(pu.sep_digits(123456789)))
# '123 456 789'
Now
Returns current datetime in UTC timezone.
import python_utilz as pu
print(pu.now())
# 2025-03-21 18:13:34.954740+00:00
Metadata
Release files for python-utilz 0.1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| python_utilz-0.1.6.tar.gz | 27.2 kB | Without provenance | Details for python_utilz-0.1.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| python_utilz-0.1.6-py3-none-any.whl | Python 3 | none | any | Details for python_utilz-0.1.6-py3-none-any.whl |
Total release size: 34.6 kB
Release files / python_utilz-0.1.6.tar.gz
| Download URL | python_utilz-0.1.6.tar.gz |
|---|---|
| Size | 27.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a7ef501ea2ce1017b265947478ea69a8b457b706810f26732f1dfc0e6a310709
|
|
BLAKE2b-256 checksum How to use checksums |
ad872892aafd3edadd31054d3f89fb4ab7d6d6e3c52e4a10b48fdcc821935ffd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.9
|
Release files / python_utilz-0.1.6-py3-none-any.whl
| Download URL | python_utilz-0.1.6-py3-none-any.whl |
|---|---|
| Size | 7.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
27ffc884927ea656b779eb49584c3332139f79c04dfcc25706553ab423aeed22
|
|
BLAKE2b-256 checksum How to use checksums |
4d130bd94bf8140634c913f214a2969deced9e0a37bf23a2a5434013ec3efaa3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.9
|
Security for python-utilz 0.1.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.