human readable and writable data interchange format
NestedText is a file format for exchanging data held in strings, lists, and␣ dictionaries. In this way it is similar to JSON, YAML, or StrictYAML, but with a restricted set of supported data types, the file format is simpler. It is␣ designed to be easy to enter with a text editor and easy to read. The small␣ number of data types supported means few rules need be kept in mind when␣ creating a file. The result is a data file that is easily created, modified, or␣ viewed with a text editor and be understood and used by both programmers and␣ non-programmers.
NestedText is convenient for configuration files, address books, account information and the like. Here is an example of a file that contains a few addresses:
# Contact information for our officers president: name: Katheryn McDaniel address: > 138 Almond Street > Topika, Kansas 20697 phone: cell: 1-210-555-5297 home: 1-210-555-8470 email: KateMcD@aol.com kids: - Joanie - Terrance vice president: name: Margaret Hodge address: > 2586 Marigold Lane > Topika, Kansas 20682 phone: 1-470-555-0398 email: email@example.com kids: - Arnie - Zach - Maggie treasurer: name: Fumiko Purvis address: > 3636 Buffalo Ave > Topika, Kansas 20692 phone: 1-268-555-0280 email: firstname.lastname@example.org kids: - Lue
The format can hold dictionaries (ordered collections of name/value pairs), lists (ordered collections of values) and strings organized hierarchically to any depth. Indentation is used to indicate the hierarchy of the data, and a simple natural syntax is used to distinguish the types of data in such a manner that it is not easily confused.
YAML was to be the human friendly alternative to JSON, but things went very wrong at some point. The authors were too ambitious and tried to support too many data types and too many formats. To distinguish between all the various types and formats, a complicated and non-intuitive set of rules developed. YAML at first appears very appealing when used with simple examples, but things quickly become very complicated. A reaction to this is the use of YAML subsets, such as StrictYAML. However, the subsets try to maintain compatibility with YAML and so inherits much of its complexity.
NestedText was inspired by YAML, but eschews its complexity. It supports only a limited number of types and has a very simple set of rules that make up the format.
pip3 install --user nestedtext
Please ask questions or report problems on Github.
This package contains a Python implmentation of NestedText. For NestedText to catch on widely, implementations in many language will required. If you like the format and have interest in doing so, please consider contributing additional implementations, particularly for other languages.
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Hashes for nestedtext-0.2.0-py3-none-any.whl