Metadata-Version: 2.4
Name: minwei_tools
Version: 0.1.1
Summary: Some useful tools for Python development
Home-page: https://github.com/OuYangMinOa/minwei_tools
Author: OUYANGMINWEI
Author-email: wesley91345@gmail.com
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python
Dynamic: summary

# 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

```bash
pip install minwei_tools
```

# Usage

* ## Dotter

    ```python
    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



    ```python
    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}")
    ```
