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

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

Uploaded Python 3

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