simple python module for KoiLang parsing
Project description
Kola
Simple python module for KoiLang parsing.
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 function calling below:
draw(
"Line", 2,
pos0={"x": 0, "y": 0},
pos1={"x": 16, "y": 16},
thickness=2,
color=[255, 255, 255]
)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file KoiLang-0.1.0b0.tar.gz
.
File metadata
- Download URL: KoiLang-0.1.0b0.tar.gz
- Upload date:
- Size: 167.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ba2337fc5e1359e0c9d5efbb92082b17ad5f15dd59be65b94ff2eec8197fb1f |
|
MD5 | 29cc1474ad601d084df85310230c5484 |
|
BLAKE2b-256 | 65c543a3f1f90a2d4322986b3b7b3817d88dd4dcf85c543c0b955b354fcbf522 |
File details
Details for the file KoiLang-0.1.0b0-cp38-cp38-win_amd64.whl
.
File metadata
- Download URL: KoiLang-0.1.0b0-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 81.8 kB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d87c5edc8f93d6b531bcce779177ab39ce28a78df482f91c9b0856b1e5192ea |
|
MD5 | 2a93291508d23fea21d99f39b725c8fa |
|
BLAKE2b-256 | c5dacc941d5ade4df50a65037ac7e7dc20a8a3c3bc818b41b19764f1b2ee0ab0 |
File details
Details for the file KoiLang-0.1.0b0-cp36-cp36m-win_amd64.whl
.
File metadata
- Download URL: KoiLang-0.1.0b0-cp36-cp36m-win_amd64.whl
- Upload date:
- Size: 91.7 kB
- Tags: CPython 3.6m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad80a130506f7ef0cade4f8fb3ec25b94bf5630555232afcf102432766508e75 |
|
MD5 | 3880035682b82cbcfe90b1241ce2281a |
|
BLAKE2b-256 | 2b308e3249b4931ddf9d90a1b53f2fa0cd101e7e407baf634667ef326a5629d8 |