A tool for awesome python utils
Project description
utilyzer
A tool for awesome python utils
Installation
pip install utilyzer
Features
-
String to Number conversion with support for:
- Integer conversion
- Float conversion
- Scientific notation
- Whitespace handling
- Robust error handling
-
Date utilities with support for:
- Getting day ranges with timestamps
- Timezone awareness
- Flexible day lookback
Quick Start
from utilyzer import str_to_number
# Convert string to integer
str_to_number("123") # 123
# Convert string to float
str_to_number("12.34") # 12.34
# Convert string to scientific notation
str_to_number("1e-10") # 1e-10
# Handle whitespace
str_to_number(" 123 ") # 123
# Handle invalid input
str_to_number("abc") # None
# Handle empty string
str_to_number("") # None
# Handle None
str_to_number(None) # None
Date Utilities
from utilyzer import get_day_range
# Get today's range
today = get_day_range()
# Get yesterday's range
yesterday = get_day_range(1)
# Get range with different timezone
hk_time = get_day_range(0, timezone='Asia/Hong_Kong')
Requirements
- Python >= 3.8
- Python < 3.12
Development on local, check code quality
# First review the changes
black --check --diff --preview src tests
# Then apply them if you're happy with the proposed changes
black --preview src tests
# Check ruff
ruff check src tests
# Fix ruff
ruff check --fix src tests
# Check mypy
mypy src
Documentation
Full documentation is available at https://asmitul.github.io/utilyzer
License
This project is licensed under the MIT License - see the LICENSE file for details.
Author
- asmitul - GitHub
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
utilyzer-0.0.2.tar.gz
(5.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file utilyzer-0.0.2.tar.gz.
File metadata
- Download URL: utilyzer-0.0.2.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a742e4d5cdda6161e4b715d180e5a59f6516f9afccfb43c3195f9b8e65ba848
|
|
| MD5 |
df6259e4b0973170a710ea7fd0de6790
|
|
| BLAKE2b-256 |
5565892c6f48f4d916c8639df72ab63d25c2224723c37b389026e1a2d7456aae
|
File details
Details for the file utilyzer-0.0.2-py3-none-any.whl.
File metadata
- Download URL: utilyzer-0.0.2-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9bcf69895d3b21f0dce577840d2a0c54c6cb51d336be276edb61a0caf5c8cd60
|
|
| MD5 |
3065b97eccc25a5724420a284630cfeb
|
|
| BLAKE2b-256 |
810b1741b9b8518961c81120c0165f471da861ad90307728f9844a567cf36899
|