semvec/pypi-packages huggingface dataset:
torbjorn 0.1.1
Provide some practical Python decorators.
License: MIT License
Requires Python: >=3.6

# Torbjorn

[![Pypi](https://img.shields.io/pypi/v/torbjorn.svg)](https://pypi.org/project/torbjorn/)
[![MIT License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/Ailln/torbjorn/blob/master/LICENSE)
[![stars](https://img.shields.io/github/stars/Ailln/torbjorn.svg)](https://github.com/Ailln/torbjorn/stargazers)
[![build](https://img.shields.io/github/workflow/status/Ailln/torbjorn/build)](https://github.com/Ailln/torbjorn/actions?query=workflow%3Abuild)

🔨 提供一些实用的 Python 装饰器～

`Torbjorn`（即托比昂）是守望先锋游戏中的英雄之一，他拥有一个强力输出的炮台。
俗话说「他强任他强，我用托比昂」，我希望本项目也能给你的 Python 代码提供强力的支持！

> 🎈️ v0.1.1：
>
> 使用 `time.perf_counter` 计算时间，以提高精准度。

## 安装

```bash
# pip 安装
pip install torbjorn

# or 源码安装
git clone https://github.com/Ailln/torbjorn.git
cd torbjorn && python setup.py install
```

## 使用

- `run_time`: 计算运行时间
- `run_count`: 计算运行次数
- `ctrl_c`: 程序终止验证

```python
import logging

import torbjorn as tbn


logger = logging.getLogger(__name__)


@tbn.run_time
@tbn.run_time(name="test_time")
@tbn.run_time(logger=logger, name="test_time")
@tbn.run_count
@tbn.run_count(name="test_count")
@tbn.run_count(logger=logger, name="test_count")
@tbn.ctrl_c
def calculate_million_numbers(num):
    number = 0
    for _ in range(num):
        number += 1


if __name__ == '__main__':
    for _ in range(10):
        calculate_million_numbers(1000000)
        
# output:
# [calculate_million_numbers] run count(t): 1
# [test_count] run count(t): 1
# [test_count] run count(t): 1
# [test_time] run time(s): 0.074010
# [test_time] run time(s): 0.074463
# [calculate_million_numbers] run time(s): 0.074512
# [calculate_million_numbers] run count(t): 2
# [test_count] run count(t): 2
# [test_count] run count(t): 2
# [test_time] run time(s): 0.074386
# [test_time] run time(s): 0.074522
# [calculate_million_numbers] run time(s): 0.074556
# ^CAre you sure to quit? (yes|y) / (no|n)
# >> 123
# ^CAre you sure to quit? (yes|y) / (no|n)
# >> no
# [calculate_million_numbers] run count(t): 3
# [test_count] run count(t): 3
# [test_count] run count(t): 3
# [test_time] run time(s): 0.072722
# [test_time] run time(s): 0.072863
# [calculate_million_numbers] run time(s): 0.072897
# ^CAre you sure to quit? (yes|y) / (no|n)
# >> yes
# >> exit...
```

## 许可

[![](https://award.dovolopor.com?lt=License&rt=MIT&rbc=green)](./LICENSE)
corut-installer 0.0.19
Makes the necessary installations for python on Linux/Windows systems with GUI
License: MIT License
Requires Python: >=3.7
Keywords: cörüt, corut, corut_installer, installer


 ## corut_installer
It is aimed to facilitate the necessary installations for python with the tkinter interface on 
Linux and Windows systems.

For Linux, tkinter should be installed with "sudo apt-get install python3-tk".

Details will be shared on https://www.ibrahimcorut.com/en/projects/pypi-corut-installer/

MIT License

Copyright (c) 2021 ibrahim CÖRÜT

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.