Skip to main content

Python library by Heekang Park

Project description

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 기능 추가, 버그 수정

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hk_libs-1.2.1-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file hk_libs-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: hk_libs-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for hk_libs-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 06bb74f01a12d09ec72513603da65faa3491ec14f193593ee05425c5cba4d3d7
MD5 0d259a2e9b09f4e93b286625b32f26a6
BLAKE2b-256 469f633f906cc8f34a041d20d07381bbaf74f3a78111ca5e3d77419b9cb239eb

See more details on using hashes here.

Supported by

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