Skip to main content

utilyzer

A tool for awesome python utils

PyPI version ci-cd License: MIT Python Versions PyPI Downloads

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

Metadata

Release files for utilyzer 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for utilyzer 0.0.3
File Size Uploaded Provenance Actions
utilyzer-0.0.3.tar.gz 5.5 kB Without provenance Details for utilyzer-0.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for utilyzer 0.0.3
File Interpreter ABI Platform Actions
utilyzer-0.0.3-py3-none-any.whl Python 3 none any Details for utilyzer-0.0.3-py3-none-any.whl

Total release size: 10.4 kB

Release files / utilyzer-0.0.3.tar.gz

Download URL utilyzer-0.0.3.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
32713652cf45eb76e9b6276b588ffed03fb4133571abf374f54f304598780e53
BLAKE2b-256 checksum
How to use checksums
88dddc0c0e0ecda1e650e6597cb37b6b3887f71eac52abe0ff23046a02586fe1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.28.1

Release files / utilyzer-0.0.3-py3-none-any.whl

Download URL utilyzer-0.0.3-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
23ba3523911f7235d6fbc577238a433454fa57171247f7829f179352c049da37
BLAKE2b-256 checksum
How to use checksums
b5016d4b9aab64827a801d2d00d630457cb58d1b7127050d031e3ada1e05f2e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.28.1

Security for utilyzer 0.0.3

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page