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

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.
  • 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.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

ntanh-0.1.6-py2.py3-none-any.whl (9.1 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: ntanh-0.1.6.tar.gz
  • Upload date:
  • Size: 5.2 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.tar.gz
Algorithm Hash digest
SHA256 0ea0382be73328bcfb2bee725aed6d5e84e9ca5d4a6c334afd44dd8c442d1dcd
MD5 dee64727dd396e4043a6223db4c0fce8
BLAKE2b-256 691d15b845b578b6771f2458b5719751da7ed9cc9142eaa565d20765af0a6c7a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ntanh-0.1.6-py2.py3-none-any.whl
  • Upload date:
  • Size: 9.1 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-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c28b6144a1248fdd37733e6246d7361bb21908cd9e2fc348d50b2de978763109
MD5 6987e5a5faf305dfb4d149d3ed472d66
BLAKE2b-256 0418dad9763808ae011f4ccd755b5d5bb7ed9d74134bc9cc1d3c3afd61e1e266

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