Skip to main content

Add your description here

Project description

minwei_tools

This tools contain 3 major function

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

Install

pip install minwei_tools

Usage

  • File Transfer server

    python -m minwei_tools.server -p {port} -h {host}
    
  • Dotter

    alt text

    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)
    

    Also support an async dotter

    from time import sleep
    import asyncio
    
    from minwei_tools import AsyncDotter
    
    async def main():
        async with AsyncDotter("Thinking", show_timer=True, delay=0.1):
            await asyncio.sleep(120)
    
    asyncio.run(main())
    
  • 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.7.tar.gz (7.1 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.7-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for minwei_tools-0.1.7.tar.gz
Algorithm Hash digest
SHA256 e670254a85a350211e3e1079f75ba74c57eb4186dcfae5fd48ff81cd647cb262
MD5 a7f1cead4e22d02d21ed8e5d980bf52b
BLAKE2b-256 101c985b43d81c780e9d37191d5e165fe7864fc2f8f2680b613fa77f726ce23d

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for minwei_tools-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 1dd84ccf75d4cf1d7bb73048529f3e0886002a5c4f4a41334d8c70be0bc767cf
MD5 1aa71bf65ea451a3b02211ce52b8f7d4
BLAKE2b-256 143304936dc9d4b0f2fccde43a96fee6c1d236dc54d44a8513d933091ae65ef2

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