Skip to main content

A tool for awesome python utils

Project description

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

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

utilyzer-0.0.3.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

utilyzer-0.0.3-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file utilyzer-0.0.3.tar.gz.

File metadata

  • Download URL: utilyzer-0.0.3.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.28.1

File hashes

Hashes for utilyzer-0.0.3.tar.gz
Algorithm Hash digest
SHA256 32713652cf45eb76e9b6276b588ffed03fb4133571abf374f54f304598780e53
MD5 cebf13adf2552ccb2c6ffb0f6a8090f7
BLAKE2b-256 88dddc0c0e0ecda1e650e6597cb37b6b3887f71eac52abe0ff23046a02586fe1

See more details on using hashes here.

File details

Details for the file utilyzer-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: utilyzer-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.28.1

File hashes

Hashes for utilyzer-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 23ba3523911f7235d6fbc577238a433454fa57171247f7829f179352c049da37
MD5 bd6124dacd309a2c6a2b1ca29583c80f
BLAKE2b-256 b5016d4b9aab64827a801d2d00d630457cb58d1b7127050d031e3ada1e05f2e2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page