Skip to content

ArcletProject/Alconna-Notation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Alconna Notation

HOCON 为基础的序列化/反序列化工具,用于转换 Alconna

示例

import arclet.alconna.notation as alcon

# 从字符串解析
alc = alcon.loads(
"""\
command = test
args {
    foo = str
    bar = int
}
options = [
    {
        name = --spam
        aliases = [-s]
        default = true
        action = store_false
    }
    {
        name = --eggs
        aliases = [-e]
        args {
            count = int
        }
        default = 0
    }
]
"""
)

assert alc.parse("test abc 123 -s").query("foo") == "abc"

About

serializer & deserializer of Alconna

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages