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 bằng các cách sau:

pip install ntanh
pip install --upgrade --force-reinstall ntanh
pip install --upgrade ntanh --no-deps

Cài trực tiếp trong code:

try:
    os.system("python -m pip install --upgrade ntanh --no-deps")
except Exception as e:
    print('ntanh:', e)
import 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.2.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

ntanh-0.1.6.2-py2.py3-none-any.whl (9.6 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: ntanh-0.1.6.2.tar.gz
  • Upload date:
  • Size: 5.6 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.2.tar.gz
Algorithm Hash digest
SHA256 e4f235cadc98bf38ffc434433e42a402b9958bce21a834f941480b066eef037f
MD5 1ef3b1238553eb0b2268980195672328
BLAKE2b-256 0041973f24e71ea03d5e40d12da515140de9cc33545e8ea8f35acbe6e6e07b62

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ntanh-0.1.6.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 9.6 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.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ddc48a46c7ab72fb87860e935598c48c5c96c363c22e1a8cf43c15dec82a5fc1
MD5 5e8d7ca536903ae5f10d31a69923ad28
BLAKE2b-256 b759b5faefc07d030c41ee8adeea49945aaf67822593df9a152c7d8f1c987543

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