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.6.tar.gz (6.7 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.6-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: minwei_tools-0.1.6.tar.gz
  • Upload date:
  • Size: 6.7 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.6.tar.gz
Algorithm Hash digest
SHA256 efa52c1c4a6d99026ba913fc1997114c262e44a2b64bf2664e3eb7033e36428e
MD5 a33cdc1211ddd7cba85bf0e5ad6e4401
BLAKE2b-256 f8c845da9b1a2887e8b2159f9fefaee052cade24bd1f406921d9df924aab75c6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: minwei_tools-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 7.7 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 3351da8ec2a2f931c18631dd29d6314b352bed8a19c40315b8ff91aeee80418f
MD5 375c6849d9d768762ef4f7bc0ec875c5
BLAKE2b-256 03e788ab7952ba7e8b44076950a619a00a1a00a28756d170b2bc61c62cce328a

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