Skip to main content

human readable and writable data interchange format

Project description

https://pepy.tech/badge/nestedtext/month https://img.shields.io/readthedocs/nestedtext.svg https://github.com/KenKundert/nestedtext/actions/workflows/build.yaml/badge.svg https://coveralls.io/repos/github/KenKundert/nestedtext/badge.svg?branch=master https://img.shields.io/pypi/v/nestedtext.svg https://img.shields.io/pypi/pyversions/nestedtext.svg
Authors: Ken & Kale Kundert
Version: 3.5
Released: 2022-11-04
Documentation: nestedtext.org.
Please post all questions, suggestions, and bug reports to: Github.

NestedText is a file format for holding structured data to be entered, edited, or viewed by people. It organizes the data into a nested collection of dictionaries, lists, and strings without the need for quoting or escaping. A unique feature of this file format is that it only supports one scalar type: strings.  While the decision to eschew integer, real, date, etc. types may seem counter intuitive, it leads to simpler data files and applications that are more robust.

NestedText is convenient for configuration files, address books, account information, and the like. Because there is no need for quoting or escaping, it is particularly nice for holding code fragments. Here is an example of a file that contains a few addresses:

# Contact information for our officers

Katheryn McDaniel:
    position: president
    address:
        > 138 Almond Street
        > Topeka, Kansas 20697
    phone:
        cell: 1-210-555-5297
        home: 1-210-555-8470
            # Katheryn prefers that we always call her on her cell phone.
    email: KateMcD@aol.com
    additional roles:
        - board member

Margaret Hodge:
    position: vice president
    address:
        > 2586 Marigold Lane
        > Topeka, Kansas 20682
    phone: 1-470-555-0398
    email: margaret.hodge@ku.edu
    additional roles:
        - new membership task force
        - accounting task force

One of the more attractive use-cases for NestedText is command line programs whose output is meant to be consumed by either people or programs. Many programs do so by supporting a --json command-line flag that indicates the output should be computer readable rather than human readable. But, with NestedText it is not necessary to make people choose. Just output the result in NestedText and it can be read by people or computers. For example, consider a program that read your address list and output particular fields on demand:

> address --email
Katheryn McDaniel: KateMcD@aol.com
Margaret Hodge: margaret.hodge@ku.edu

This could output could be fed directly into another program that accepted input as NestedText:

> address --email | mail-to-list

Contributing

This package contains a Python reference implementation of NestedText and a test suite. Implementation in many languages is required for NestedText to catch on widely. If you like the format, please consider contributing additional implementations.

Also, please consider using NestedText for any applications you create. It is especially suitable for configuration files.

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

nestedtext-3.5.tar.gz (23.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nestedtext-3.5-py3-none-any.whl (23.1 kB view details)

Uploaded Python 3

File details

Details for the file nestedtext-3.5.tar.gz.

File metadata

  • Download URL: nestedtext-3.5.tar.gz
  • Upload date:
  • Size: 23.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.7

File hashes

Hashes for nestedtext-3.5.tar.gz
Algorithm Hash digest
SHA256 9beced9cb39e5e0d05148393f5279b0e1cc4868a8bb11800dc03dd07a5e2c3d7
MD5 572be9ff1bf17facea083bfb0bd313c5
BLAKE2b-256 a5f6d648899c46a3341cc34b5ce8c3cb1a634b679596b6eb2fb2440ab53a80e5

See more details on using hashes here.

File details

Details for the file nestedtext-3.5-py3-none-any.whl.

File metadata

  • Download URL: nestedtext-3.5-py3-none-any.whl
  • Upload date:
  • Size: 23.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.7

File hashes

Hashes for nestedtext-3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 fcb1eb868963221c0f93fc9c4d690e7394df92509b31df0cff4c277558586bda
MD5 1ab13d1aaf3cfcc31e343f838b94cd47
BLAKE2b-256 880715ac769fd868dda765d336e424eea20d86fa52831494505c6ef3f9be175d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page