banksalad / K-Format

๐Ÿ‡ฐ๐Ÿ‡ท Python library for Korean style fixed length format definition(์ „๋ฌธ ํ†ต์‹ )

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

๐Ÿ‡ฐ๐Ÿ‡ท Python library for Korean style fixed length format definition(์ „๋ฌธ ํ†ต์‹ )

License:MIT License


Languages

Language:Python 97.8%Language:Makefile 2.2%