Skip to content

🇰🇷 Python library for Korean style fixed length format definition(전문 통신)

License

Notifications You must be signed in to change notification settings

banksalad/K-Format

Repository files navigation

K-Format

Build Status PyPI PyPI - Python Version Rainist codecov

K-Format is a Python library designed for dealing with KCB K-Format in a convenient way.

Getting Started

from kformat import *


@kclass
class Item:
    sth: N(2)


@kclass
class Base:
    """
    AN: `alpha-numeric`
    N: `numberic`
    """

    birthday: AN(8)
    name: AN(10)
    grade: N(3)
    items: List[Item]


base = Base(date(1980, 8, 12), '홍길동', 1, [Item(3), Item(4)])
assert base.bytes == b'19800812\xc8\xab\xb1\xe6\xb5\xbf    0010304'

Installation

pip install K-Format