Skip to main content

simple python module for KoiLang parsing

Project description

Kola

Simple python module for KoiLang parsing.

License PyPI Python Version

Installation

From pip:

pip install KoiLang

From source code:

python setup.py build_ext --inplace
python setup.py install

What is KoiLang

KoiLang is a markup language while is easy to read for people. There is an simple example.

#hello KoiLang
I am glad to meet you!

In KoiLang, file is divided into 'command' part and 'text' part. The formation of command part is like C preprocessor directive, using '#' as starting. And text is surrounding commands.

#command "This is a command"
This is a text.

Each command can have several arguments behind the command name. Valid argument type include integer, float, literal and string.

#arg_int    1 0b101 0x6CF
#arg_float  1.0 2e-2
#arg_literal __name__
#arg_string "A string"

Here "literal" is a valid python variety name containing letter, digit, underline and not starting with digit. Usually it is same as a string.

There is another kind of arguments -- keyword arguments which formation is as this:

#kwargs key(value)

And another format:
#keyargs_list key(item0, item1)

And the third:
#kwargs_dict key(x: 11, y: 45, z: 14)

All the arguments can be put together

#draw Line 2 pos0(x: 0, y: 0) pos1(x: 16, y: 16) \
    thickness(2) color(255, 255, 255)

What can Kola module do

Kola module provides a fast way to convert KoiLang command to a python function call.

Above command #draw will convert to calling below:

draw(
    "Line", 2,
    pos0={"x": 0, "y": 0},
    pos1={"x": 16, "y": 16},
    thickness=2,
    color=[255, 255, 255]
)

Project details


Download files

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

Source Distribution

KoiLang-0.1.0a2.tar.gz (166.4 kB view details)

Uploaded Source

Built Distributions

KoiLang-0.1.0a2-cp38-cp38-win_amd64.whl (80.5 kB view details)

Uploaded CPython 3.8 Windows x86-64

KoiLang-0.1.0a2-cp36-cp36m-win_amd64.whl (90.6 kB view details)

Uploaded CPython 3.6m Windows x86-64

File details

Details for the file KoiLang-0.1.0a2.tar.gz.

File metadata

  • Download URL: KoiLang-0.1.0a2.tar.gz
  • Upload date:
  • Size: 166.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.12 tqdm/4.64.0 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.13

File hashes

Hashes for KoiLang-0.1.0a2.tar.gz
Algorithm Hash digest
SHA256 4ecd9c7f56cd7013ca06b7b38f98b8fc8bfbc364b25d2de3038e2516d188d340
MD5 b6e0c4cf5ea38711d02f5bc2291f49f5
BLAKE2b-256 8ebf16c90b8ee322e8bfdad3bbe9568cad69a7322d30810f34e8520daa980056

See more details on using hashes here.

File details

Details for the file KoiLang-0.1.0a2-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: KoiLang-0.1.0a2-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 80.5 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.12 tqdm/4.64.0 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.13

File hashes

Hashes for KoiLang-0.1.0a2-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 e3dac6e50427293e738c7095491df97c6c5e3891685df2a96cf19167b1af3f93
MD5 fb5aa067a4f1ccb7a585a3b96ff51cf4
BLAKE2b-256 f7c81887907b2fb4890a03cf9a4c1be85358dbfa2f6da598ffffe11b1e4364d4

See more details on using hashes here.

File details

Details for the file KoiLang-0.1.0a2-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: KoiLang-0.1.0a2-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 90.6 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.12 tqdm/4.64.0 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.13

File hashes

Hashes for KoiLang-0.1.0a2-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 041a4d49d702372cd35dd64b794c72ecc86dde70a4922c0a83ce58032f48b50a
MD5 8be94db8640ff5611fb559b01676c15b
BLAKE2b-256 60a842d28c03e000995131f820e67fb0511e7c4a7a9705888f6c43027a03e178

See more details on using hashes here.

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