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ả:

['../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']
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'}

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

Uploaded Source

Built Distribution

ntanh-0.1.4-py2.py3-none-any.whl (7.1 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: ntanh-0.1.4.tar.gz
  • Upload date:
  • Size: 4.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.4.tar.gz
Algorithm Hash digest
SHA256 cca15d9ec3b6fc6d578d31205a61d5e77dfea00c43405c56500ebde286804f0d
MD5 90a4443d44c591403c4bf96b002a80bd
BLAKE2b-256 415a39b7dd5c43a06c2eacf9f9e633e10fb6aa27e27ea74eb3b5803fd1303bba

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ntanh-0.1.4-py2.py3-none-any.whl
  • Upload date:
  • Size: 7.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.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 7c3105bb32e41a5dfed6891f8eb96d87f9e1dee56ad403f63c1fa2d2e7486f51
MD5 2e62b8127a00fdec10d0a6d0549f5302
BLAKE2b-256 cc970daf43b956caa8ceaf49d44c039cc02dd7e4f97bbcb272600abf3895f3d2

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