Thư viện hữu ích của Tuấn Anh.
Project description
Giới thiệu
tatools là một thư viện các nhiệm vụ hàng ngày sử dụng, hay dùng nhưng không khó, mất thời gian code cho các dự án lẻ tẻ.
Cài đặt bằng các cách sau:
pip install tatools
pip install --upgrade --force-reinstall tatools
pip install --upgrade tatools --no-deps
Cài trực tiếp trong code:
try:
os.system("python -m pip install --upgrade --force-reinstall tatools --no-deps")
except Exception as e:
print('tatools:', e)
import tatools
Cách dùng:
from pprint import pprint
from tatools.ParamsBase import tactParametters
import tatools
print(tatools.__version__)
mParams = tactParametters()
fns = mParams.fnFIS(r"../", exts=(".py"))
pprint(fns)
Kết quả:
['../tact/setup.py',
'../tact/__init__.py',
'../tact/tatools/__init__.py']
Ví dụ 2: tạo file tham số:
from pprint import pprint
from tatools.ParamsBase import tactParametters
class Parameters(tactParametters):
def __init__(self, ModuleName="TACT"):
super().__init__()
self.thamso1 = "thamso1"
self.thamso2 = " xâu tiếng việt"
self.api_url = "https://200.168.90.38:6699/avi/collect_data"
self.testpath = "D:/test_debug_fii"
self.test_real = 0.8
self.test_int = 12
self.test_dict = {
1: 2,
3: 4.5,
"6": "bảy nhá",
-1: "Tám",
9: [10, 11.2, "22", (33, 44, "55")],
10: {101: 12, 102: "mười ba"},
}
self.test_list = [1, 2, 3, 4, 5, 6, 7, 8, 9]
self.load_then_save_to_yaml(file_path="configs_test.yml", ModuleName=ModuleName)
self.privateVar1 = 2
self.privateVar2 = "Not in param file"
mParams = Parameters(ModuleName="test")
pprint(mParams.__dict__)
Kết quả:
{'ModuleName': 'test',
'api_url': 'https://200.168.90.38:6699/avi/collect_data',
'fn': 'configs_test.yml',
'logdir': '',
'privateVar1': 2,
'privateVar2': 'Not in param file',
'test_dict': {-1: 'Tám',
1: 2,
3: 4.5,
9: [10, 11.2, '22', (33, 44, '55')],
10: {101: 12, 102: 'mười ba'},
'6': 'bảy nhá'},
'test_int': 12,
'test_list': [1, 2, 3, 4, 5, 6, 7, 8, 9],
'test_real': 0.8,
'testpath': 'D:/test_debug_fii',
'thamso1': 'thamso1',
'thamso2': ' xâu tiếng việt'
}
Console Running
Version changed
- Version 0.2:
- Bản quyền tatools tương thích với cả Ubuntu
- Version 0.1:
- Test & upload.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tatools-0.2.tar.gz
(10.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
tatools-0.2-py2.py3-none-any.whl
(13.7 kB
view details)
File details
Details for the file tatools-0.2.tar.gz.
File metadata
- Download URL: tatools-0.2.tar.gz
- Upload date:
- Size: 10.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0244370beb24496ff0d515d2a42bf6c3d7436f7fee623b4e1e9877622746233f
|
|
| MD5 |
179df5abbed4dc84ede33db70651dbd1
|
|
| BLAKE2b-256 |
228793c3da517c4ac1a09afa5edf336f456acf6519a3f11265edf36d0b423af9
|
File details
Details for the file tatools-0.2-py2.py3-none-any.whl.
File metadata
- Download URL: tatools-0.2-py2.py3-none-any.whl
- Upload date:
- Size: 13.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8892e8408f50bb94d55cdec1c538f22476e33517ff72c1ab1fca7573278ad34
|
|
| MD5 |
7aebbb117d50d2b6f4af6ae7f201d20c
|
|
| BLAKE2b-256 |
49d63f405f90ed76ad3ea061ccea25b98f8794e5222765d62ffafa110b444401
|