semvec/pypi-packages huggingface dataset:
hanamaki 1.0.1
fun progress bar and timer!
License: MIT
Requires Python: >=3.7

# Hanamaki

## fun progress bar and timer!

### Release: 1.0.1

English | [简体中文](./README_zh.md)

![run status](./docs/images/run.png)

```
my bar: 100.00% |==============================| 50/50, 108.1ms/step, Elapsed Time: 5.40491748s.
Training: 100.00% |==============================| 50/50, 107.3ms/step, Elapsed Time: 5.36405754s.
Training: 100.00% |●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●| 50/50, 108.1ms/step, Elapsed Time: 5.40394497s.
Training: 100.00% |******************************| 50/50, 108.0ms/step, Elapsed Time: 5.39926910s.
Training: 100.00% |██████████████████████████████| 50/50, 107.6ms/step, Elapsed Time: 5.38197231s.
Training: 100.00% |👉👉👉👉👉👉👉👉👉👉👉👉👉👉👉👉👉👉👉👉👉👉👉👉👉👉👉👉👉👉| 50/50, 107.7ms/step, Elapsed Time: 5.38526702s.
```

## Installation

> Python 3.7+

```
pip install hanamaki
```

## Example

### import

```python
from hanamaki import *
```

### funProgress

```python
n = 50
print(funProgress(range(5,n+5)))

for i,j in enumerate(funProgress(range(5,n+5))):
    time.sleep(0.1)
```

```python
p = funProgress(n, desc = 'Training')
for i,j in enumerate(range(n)):
    time.sleep(0.1)
    p.update(i)
```

```python
p = funProgress(n, desc = 'Training',color='red',forward = 'circles', back = 'backhand')
for i,j in enumerate(range(n)):
    time.sleep(0.1)
    p.update(i)
```

```python
with funProgress(n,desc = "Training",color='orange',forward = 'classic7', back = 'checks') as p:
    for i,j in enumerate(range(n)):
        time.sleep(0.1)
        p.update(i)
```

```python
p = funProgress(n, desc = 'Training',color='blue',forward = 'smooth', back = 'classic0')
for i,j in enumerate(range(n)):
    time.sleep(0.1)
    p.update(i)
```

```python
with funProgress(n,desc = "Training",color='green',forward='backhand') as p:
    for i,j in enumerate(range(n)):
        time.sleep(0.1)
        p.update(i)
```

### funTimer

```python
with funTimer(desc = "process range time: "):
    s = [x for x in range(100)]
    with funTimer(desc = "one process time: "):
        b = [x for x in range(100)]
```

```python
import logging
logging.basicConfig(
    level = logging.INFO,
    format = "%(levelname)s: [%(asctime)s] - [%(filename)s / line: %(lineno)d] - [%(message)s]"
)
logger = logging.getLogger(__name__)
logger.info("start logging")

import asyncio
@funTimer.timed_op(desc = "my timer", printer = logger)
async def async_main(a):
    for x in range(a):
        time.sleep(1)
    return x

asyncio.run(async_main(2))

@funTimer.timed_op(printer = logger)
def async_main(a):
    '''
    help me
    '''
    for x in range(a):
        time.sleep(1)
    return x

async_main(2)
```

## License

This software is licensed under the MIT License. See the LICENSE file in the top distribution directory for the full license text.