Skip to main content

A smart, modular and readable configuration file format for complex multifile solutions.

Project description

Neat Object Notation 0.3.1

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"}]}

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

neat_notation-0.4.12.tar.gz (13.1 kB view hashes)

Uploaded Source

Built Distributions

neat_notation-0.4.12-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

neat_notation-0.4.12-pp38-pypy38_pp73-win_amd64.whl (206.9 kB view hashes)

Uploaded PyPy Windows x86-64

neat_notation-0.4.12-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

neat_notation-0.4.12-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

neat_notation-0.4.12-cp311-none-win_amd64.whl (207.4 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

neat_notation-0.4.12-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

neat_notation-0.4.12-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (606.3 kB view hashes)

Uploaded CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

neat_notation-0.4.12-cp310-none-win_amd64.whl (207.4 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

neat_notation-0.4.12-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

neat_notation-0.4.12-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (606.3 kB view hashes)

Uploaded CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

neat_notation-0.4.12-cp39-none-win_amd64.whl (207.5 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

neat_notation-0.4.12-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

neat_notation-0.4.12-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (606.2 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

neat_notation-0.4.12-cp38-none-win_amd64.whl (207.4 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

neat_notation-0.4.12-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

neat_notation-0.4.12-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (606.7 kB view hashes)

Uploaded CPython 3.8 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

neat_notation-0.4.12-cp37-none-win_amd64.whl (207.4 kB view hashes)

Uploaded CPython 3.7 Windows x86-64

neat_notation-0.4.12-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

neat_notation-0.4.12-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (606.7 kB view hashes)

Uploaded CPython 3.7m macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

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