Skip to main content

Thư viện hữu ích của Tuấn Anh.

Project description

Giới thiệu

ntanh 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

pip install ntanh
pip install --upgrade --force-reinstall ntanh

Cách dùng:

from pprint import pprint
from ntanh.ParamsBase import tactParametters
import ntanh

print(ntanh.__version__)
mParams = tactParametters()

fns = mParams.fnFIS(r"../", exts=(".py"))
pprint(fns)

Kết quả:

'0.1.4'
['../tact/setup.py',
 '../tact/__init__.py',
 '../tact/build/lib/ntanh/ParamsBase.py',
 '../tact/build/lib/ntanh/__init__.py',
 '../tact/build/lib/tact/ParamsBase.py',
 '../tact/build/lib/tact/__init__.py',
 '../tact/dev/test_tact.py',
 '../tact/ntanh/ParamsBase.py',
 '../tact/ntanh/__init__.py']

Ví dụ 2: tạo file tham số:

from pprint import pprint
from ntanh.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'}

Version changed

  • V0.1.6 (2024-10-14):

    • Thêm thư viện convert yolo-bbox: from ntanh.yolo_boxes import xyxy_to_yolo_str, yolo_str_to_xyxy
    • print: ntanh.__help__ sẽ ra hướng dẫn.
    • V 0.1.6.1:
      • Thay đổi thứ tự tham số trong hàm Yolo convert, trả kết quả dạng int thay vì float khi convert yolo2bbox
  • V0.1.5 (2024-10-14):

    • Hoàn thiện chức năng tạo file config cho mỗi class: from ntanh.ParamsBase import tactParametters
    • Cập nhật readme, diễn giải nội dung.
    • Chạy ntanh.info() sẽ in ra code mẫu.
  • V0-V0.1.4:

    • Test upload.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ntanh-0.1.6.1.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

ntanh-0.1.6.1-py2.py3-none-any.whl (9.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file ntanh-0.1.6.1.tar.gz.

File metadata

  • Download URL: ntanh-0.1.6.1.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for ntanh-0.1.6.1.tar.gz
Algorithm Hash digest
SHA256 911a910f5ea60f90d06a193f4f8ab3782253bee9c7ee625b9087534b09b94fb2
MD5 665ecd18c76354d8b9303735d87ecab4
BLAKE2b-256 a6b6342b8090414677f33c85a02ce19b4cb667e363baec6e2c77731524548f6d

See more details on using hashes here.

File details

Details for the file ntanh-0.1.6.1-py2.py3-none-any.whl.

File metadata

  • Download URL: ntanh-0.1.6.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for ntanh-0.1.6.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 799e2db8da525a69b772eb4e17e96961c175bca90b468c7a7cbac478651a9c83
MD5 0413c941b9b69ad905ff86f15f869b82
BLAKE2b-256 91e6d3bc1faa0ba4b96da9eabc15be96b5ce0b39ccaf63288228519334b30f09

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page