A smart, modular and readable configuration file format for complex multifile solutions.
Project description
Neat Object Notation 0.5.14
pip install neat-notation
To load your .neat file into python, call neat_notation.load(filename:str)
. It will return a dictionary/list containing the content of your file.
A smart, modular and readable configuration file format for complex multifile solutions.
Comments
| Any lines which are to be commented out must start with a pipe character.
| The pipe must ALWAYS be at the beginning of the line for comments.
Global Scope
By default the global scope of a Neat config file is a dictionary, if you wish to specify otherwise you must put this somewhere in your .neat file on its own line
~list
Labeled Structures
[This is where you write the key associated with your dictionary]
"This is a key to an inline dictionary":{"This is the key to an inline list":()}
| This [-] token denotes the end of a dictionary.
[-]
<This is where you write the key associated with your list>
| The line below is the 0th index of this labeled list and is a list with a single item,
| That single item is an empty dictionary
({})
| This <-> token denotes the end of a list.
<->
Unlabeled Structures
If you wish to create an unlabeled structure vertically you can do so like this:
~list
{
"Some key":29873198273
}
Another example:
<section name>
{
[inner section name]
"some key": True
[-]
"another key": "abc"
}
<->
Modules
Importing only specific sections of a module:
| This file is called filename.neat
<section name>
{
[inner section name]
"some key": True
[-]
"another key": "abc"
}
<->
|this is where we are importing the module
mod filename : 'section name'.0.'inner section name'
| Alternate syntax
* foldername.filename : 'section name'.0.'inner section name'
Importing a whole module:
|this file is called module.neat
[section]
1:"abc"
[-]
| This is where we import module.neat
mod module
[another section]
"def":2
[-]
| Result:
| {"module":{"section":{"1":"abc"}},"another section":{"def":2}}
Alias
Aliases can be used to add items to sections outside of that section and its parent. The left hand side of the : is the alias name. The right hand side of the : is the alias path.
<section name>
{
[inner section name]
"some key": True
[-]
"another key": "abc"
}
<->
| this is the alias declaration
alias alias_name : [section name] 0 [inner section name]
| the name of the alias, in this case alias_name, marks the start of an alias section.
alias_name
"some other key": false
| The /-/ token marks the end of an alias section
/-/
| Result:
| {"section name":[{"inner section name":{"some key":True,"some other key":False},"another key":"abc"}]}
Environment Variables
Environment variables can be used in strings and section keys.
| For this example lets say ENVIRONMENT_VARIABLE_NAME = "3"
[:{ENVIRONMENT_VARIABLE_NAME}:]
":{ENVIRONMENT_VARIABLE_NAME}:" : "this is ENVIRONMENT_VARIABLE_NAME's value -> :{ENVIRONMENT_VARIABLE_NAME}:"
[-]
| output:
| {'3': {'3': 'This is ENVIRONMENT_VARIABLE_NAME's value -> 3'}}
To denote an environment variable wrap the variable name in :{
and }:
it works the same way as an f-string in python.
Auto-Increment
When inside a dictionary you can prefix values with - value
to autoincrement their key as an integer from the last integer key you set. For example:
[section]
- "foo"
- "bar"
- 123
7: true
- 0.1
- -22.2
- -12
[-]
| output:
| {"section":{0: "foo", 1: "bar", 2: 123, 7: True, 8: 0.1, 9: -22.2, 10: -12}}
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
Built Distributions
Hashes for neat_notation-0.5.14-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 113fd18fcf7f000c2aaeffe582e52b3a15b0e728c6f50cbb00b9266a1bd48288 |
|
MD5 | e93bb0ee5b35fe6f18dba86df8c0c7c6 |
|
BLAKE2b-256 | 5245fdcfe390df75dd11fc1358bf2364d6a69ffbb68ab3cfd163021901f1a0e1 |
Hashes for neat_notation-0.5.14-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1066989d4d375c9a6995c7c12137444d442555ce093d3ecd9e4318d22da6bcc |
|
MD5 | be206ff2f94201e5198e1a18895e2060 |
|
BLAKE2b-256 | 0dd006881cbd091837049d446d4139ef8361493a24d4cb94e23b6ef1f70d2020 |
Hashes for neat_notation-0.5.14-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 022825f8528470b6b38b1d58174ddae4e3dcb9fd8340e6040232c2648764b6b3 |
|
MD5 | c7e2e5a2457ecea926acd0ed14743d19 |
|
BLAKE2b-256 | bf0fa2822b5e7ad4a2511a9c7f03f4a60bd3f25c4dbd427d29de5b9ee52b2678 |
Hashes for neat_notation-0.5.14-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86b0049a739077269871a42d0f19437bf766da1c62859d1893da714232549547 |
|
MD5 | 092ca03e2f0b41016badec23573680c5 |
|
BLAKE2b-256 | 8c0fe591a3510bbb30a9f8df54c3349bb9e425b01203e450830052a9aa9461aa |
Hashes for neat_notation-0.5.14-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1248c42ae53f6e9068212b99b602f8aa3dcb05c45ea7e5ed83d2ba532a3a2922 |
|
MD5 | 7214b3f9f33740c5e1dd6ece96b7ec2a |
|
BLAKE2b-256 | 5ebded905b4df7f05631450fcbcb2ebb20b2952c6fb04214f6d001cc90c7746c |
Hashes for neat_notation-0.5.14-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9faa356e45c96948c5005051046cd99636412a66b809bc1b95d037a66348ded1 |
|
MD5 | 042f7a650a68e73fdcfce6ec53e2d773 |
|
BLAKE2b-256 | 475bf14c65bc52bc7c749c63b214cb39e4977f342c25d5bc539264659e31094f |
Hashes for neat_notation-0.5.14-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd514f1d1f6f4ef31085ff16fb42db6e70fb4839e294d65df05f4e609732bffa |
|
MD5 | ff3b9e97e1ed7d36ab9d52805c2a88d8 |
|
BLAKE2b-256 | 2c52299c00ef4c8fbeb9e9d660bcecccbc7de061bbf3e260d32d124d72ddb645 |
Hashes for neat_notation-0.5.14-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11107e00d620915fbe078009167971cf40706b10924996150b6f90790944490c |
|
MD5 | 86e028c134eaa8c0ab9017279f8484c0 |
|
BLAKE2b-256 | ee8f57287d877fc3c5ed02c86366fbfccd363746c9e7727a8644ee5731b3be51 |
Hashes for neat_notation-0.5.14-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2a6b15eb31faa3f4c6f2bf47f093b68ab2531519d93aac6240353df628dab86 |
|
MD5 | 0182cdac5695811af3445216edf6f828 |
|
BLAKE2b-256 | 39f30ad7992a7ead5aebde6f5855aacd5f9b2957a86f6f228fcb791dddd636e4 |
Hashes for neat_notation-0.5.14-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9427026ad9a08e58149dab0dcce60f20394ca7a006ceccef5d83da598ef6362d |
|
MD5 | 96b197a7a377aa8a4d8c6260328de721 |
|
BLAKE2b-256 | 289176e8d71e1f6f462258f5c7d359d70dbf6809c647c4b5f6bdbdb5ca82fa99 |
Hashes for neat_notation-0.5.14-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9aec95dde62d1a52a981f45ea3f602fbca1a0b065bd8f621dd113976c2a7037e |
|
MD5 | ca739e0366a4d10052d98aebc47be190 |
|
BLAKE2b-256 | 1a4ba30718718110c8eb6ad4cddab5966f83d07560e4f56c344047062c0db5d1 |
Hashes for neat_notation-0.5.14-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3b974baa16a48d924ac1261a1ff19a30ac10dfc81c7860c26912d9c348b87f6 |
|
MD5 | d9c039963eae19833b583aaf14f763fb |
|
BLAKE2b-256 | cbef8fb8c5de0499b3fa5ebcc8530fbcc0fb67bafcc27850da336f3ddd88dd05 |
Hashes for neat_notation-0.5.14-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fcf19dfb613e10c6ccedd8038abd0209d337132988d3786e4a631b8bdb46c867 |
|
MD5 | 2032e72c973a5edefdcf849a03e54d1e |
|
BLAKE2b-256 | 316f31fd920fa174305a88ab1e836afa7c6d48eed88c694df81e8af6338a1a9a |
Hashes for neat_notation-0.5.14-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f686b1071e16d05479cf86e05befee21e02ff2b06e812ad2bc8bc2973b59d06d |
|
MD5 | c4c6e24cabaec96b9bb5dcceacb2ba20 |
|
BLAKE2b-256 | 2e1013c45bdba29d27916c996f0b702021f6edaf10a601f89921a6299330dce1 |
Hashes for neat_notation-0.5.14-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd2d1aeba03160d1b19bef9dbe0f84590514edc6166b92211cfa5fa12f3c3380 |
|
MD5 | ccb3e7c2e17592440bd759d3c518e845 |
|
BLAKE2b-256 | 76a53bd5efaab534208fcde58031b7fd6ba78383f430efa312abf14c4955a900 |
Hashes for neat_notation-0.5.14-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ffe5898dc6e963f235c720c6aca7ae6b78904dabc76aec6190764edfab15f801 |
|
MD5 | a8813b29976449c0b20629c7c98632b7 |
|
BLAKE2b-256 | 8408c928c25710aed29fdaefed5a8de132d21b83c37ea4f310c74fd27678f175 |
Hashes for neat_notation-0.5.14-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af64f7cb366fb014f41eb5cc4029853d47cb5039ca0aaf41f3967d72ef3301b7 |
|
MD5 | b9971da5fad6f3eefd917ed912b90bc8 |
|
BLAKE2b-256 | f3d80b8a6685ad7df03fc87dfe63becefdf07097a22bc9edb97b856d6fc7fe56 |
Hashes for neat_notation-0.5.14-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9d9b1b85869853197b03f66b8a6d4d31e2927fca0e614b67138b3ad101d0d3f |
|
MD5 | 277a82380abd12ca6f407b0d240b4627 |
|
BLAKE2b-256 | 3de21ae7eca0633100bd45991b88f5201e6daf4f8708e8fbb85df8529d6bdb0e |