Skip to main content

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.

Metadata

Release files for tatools 0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tatools 0.2
File Size Uploaded Provenance Actions
tatools-0.2.tar.gz 10.9 kB Without provenance Details for tatools-0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tatools 0.2
File Interpreter ABI Platform Actions
tatools-0.2-py2.py3-none-any.whl Python 2, Python 3 none any Details for tatools-0.2-py2.py3-none-any.whl

Total release size: 24.6 kB

Release files / tatools-0.2.tar.gz

Download URL tatools-0.2.tar.gz
Size 10.9 kB
Tags Source
SHA-256 checksum
How to use checksums
0244370beb24496ff0d515d2a42bf6c3d7436f7fee623b4e1e9877622746233f
BLAKE2b-256 checksum
How to use checksums
228793c3da517c4ac1a09afa5edf336f456acf6519a3f11265edf36d0b423af9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.6

Release files / tatools-0.2-py2.py3-none-any.whl

Download URL tatools-0.2-py2.py3-none-any.whl
Size 13.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
b8892e8408f50bb94d55cdec1c538f22476e33517ff72c1ab1fca7573278ad34
BLAKE2b-256 checksum
How to use checksums
49d63f405f90ed76ad3ea061ccea25b98f8794e5222765d62ffafa110b444401
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.6

Security for tatools 0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page