Skip to main content

A parser for the yni config file.

Project description

yni

A parser for the yni config file.

Example

test.py

from yni import Yni

parser = Yni.from_file('example.yni') # here we parse from a file

parser['foo']['bar'] # get the value of the key "bar" from the header "foo", returns "spam"
# or
parser.foo.bar # returns "spam"

Example 2

test_2.py

from yni import Yni

 string = """#foo
 [
     bar: spam
 ]"""

parser = Yni.from_string(string) # here we parse from a string

parser['foo']['bar'] # get the value of the key "bar" from the header "foo", returns "spam"
# or
parser.foo.bar # returns "spam"

yni file structure

example.yni

#foo
[
    bar: spam
]

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

yni-0.1.5.tar.gz (9.6 kB view hashes)

Uploaded Source

Built Distribution

yni-0.1.5-cp38-cp38-manylinux_2_31_x86_64.whl (9.9 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.31+ x86-64

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