hk_libs [PYTHON]
간단한 python 라이브러리 모음
by Heekang Park
Requirements
- Python 3 이상
Installation
pip install hk_libs
Documentation
hk_libs.print
from hk_libs import print
print("Hello World!")
print.success("Success!")
print.error("Error!")
print.warning("Warning!")
print.info("Info!")
print.debug("Debug!")
Make print colorful with .success(), .error(), .warning(), .info(), .debug() methods.
You can still use print as usual as well.
print 함수를 사용할 때, .success(), .error(), .warning(), .info(), .debug() 메소드를 사용하여 색상을 입힐 수 있습니다.
한편 여전히 일반적인 용도로 print 함수를 사용할 수도 있습니다.
hk_libs.HKDict
from hk_libs import HKDict
x = HKDict.from_dict({
"a": 1,
"b": 2,
"c": {
"d": 3,
"e": 4,
},
"f": [
1: {
"g": 5,
"h": 6,
},
10: {
"i": 7,
"j": 8,
}
]
})
print(x.a) # 1
print(x["b"]) # 2
print(x.c.d) # 3
print(x.c["e"]) # 4
print(x.f[1].g) # 5
print(x.f[1]["h"]) # 6
print(x.f[10].i) # 7
print(x.f[10]["j"]) # 8
With HKDict, you can access dictionary keys with both dict-like syntax(ex. x["a"]) and object-like syntax(ex. x.a).
HKDict automatically convert nested dictionary as instance as well.
HKDict를 사용하면, dict와 유사한 문법(ex. x["a"])과 객체와 유사한 문법(ex. x.a)을 모두 사용할 수 있습니다.
또한, 중첩된 dict도 자동으로 HKDict 인스턴스로 변환합니다.
Changelog
v1.0
- 최초 버전
hk_print모듈 추가
v1.1
AttrDict모듈 추가
v1.2
- package name 변경 : hk_utils -> hk_libs
- file name 변경 : AttrDict.py -> HKDict.py, hk_print.py -> HKPrint.py
- class name 변경 : AttrDict -> HKDict
- HKDict 기능 추가, 버그 수정
Release files for hk-libs 1.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hk_libs-1.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Release files / hk_libs-1.2.1-py3-none-any.whl
| Download URL | hk_libs-1.2.1-py3-none-any.whl |
|---|---|
| Size | 5.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
06bb74f01a12d09ec72513603da65faa3491ec14f193593ee05425c5cba4d3d7
|
|
BLAKE2b-256 checksum How to use checksums |
469f633f906cc8f34a041d20d07381bbaf74f3a78111ca5e3d77419b9cb239eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.11
|