Skip to main content

Some useful tools for Python development

Project description

minwei_tools

This tools contain to major function

  1. Dotter : Display animated text on screen during long missions
  2. re_result : A Rust-like approach to error handling

Install

pip install minwei_tools

Usage

  • Dotter

    from minwei_tools import Dotter, piano, slash
    from time import sleep
    
    with Dotter(cycle = piano, message="Loading", delay=0.1, show_timer=1) as d:
        sleep(120)
    
  • rs_result

    from minwei_tools.rs_result import Result, Ok, Err
    
    def devide(a: int, b: int) -> Result[int, str]:
        if b == 0:
            return Err("Division by zero error")
        return Ok(a // b)
    
    """
    >>> result : Result[int, str] = devide(10, 0)
    >>> result.is_ok()
    False
    >>> result.is_err()
    >>> result : Result[int, str] = devide(10, 2)
    >>> result.is_ok()
    True
    >>> result.unwrap()
    5
    """
    
    result : Result[int, str] = devide(10, 0)
    match result:
        case Ok(value):
            print(f"Result: {value}")
        case Err(value):
            print(f"Error: {value}")
            
    result : Result[int, str] = devide(10, 2)
    match result:
        case Ok(value):
            print(f"Result: {value}")
        case Err(value):
            print(f"Error: {value}")
    

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

minwei_tools-0.1.1.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

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

minwei_tools-0.1.1-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file minwei_tools-0.1.1.tar.gz.

File metadata

  • Download URL: minwei_tools-0.1.1.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for minwei_tools-0.1.1.tar.gz
Algorithm Hash digest
SHA256 597bf7a58c7c6a9bd22f4f54046d99322b73107b1285cb1cf201454b881911cf
MD5 8ff2a70f1fe6ad6fa677ccb343bce53a
BLAKE2b-256 03a76aca808e5f69fc6308cefc996873019a9ade96af2a36302c2aa6414b1ca9

See more details on using hashes here.

File details

Details for the file minwei_tools-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: minwei_tools-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for minwei_tools-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c3eda2436198facacf831da69d4089841beef7cbd8d8e4ef86870c13581d626b
MD5 26acdea7dd018c664f7608c7424046e6
BLAKE2b-256 b4f9b3dc2c11c8bb96bba95f66251adc273efaeb80d5f032c866df83f286f2ec

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