Skip to main content

Command for cascading toml files together

Project description

Introduction

Discord Build Status Code Style: Black

Command for cascading toml "databases" into their full objects

TOML cascades are file trees that define generic configuration. Cascading allows for shared setting to be set in one place.

The root of a cascade has two files that define it:

  • .cascade.toml defines settings for cascadetoml. Settings are:
    • paths a list of strings where each string is a python format-style string. These strings are used to pull out setting defined by the path.
  • <type>.template.toml defines the full structure of the resulting TOML object. <type> is used as the name for the array of tables output when a cascade results in multiple objects. The keys in the table are the only ones allowed in TOML files within the tree. The types of values must also be consistent.

Settings for a particular folder are in a TOML file with the folder name plus the .toml extension.

The first repo using this is the nvm.toml repo. Its only path is {technology}/{manufacturer}/{sku}.toml. A file such as flash/gigadevice/GD1.toml will have the implicit values:

technology = "flash"
manufacturer = "gigadevice"
sku = "GD1"

All of the other values come from these files in order:

  • flash/flash.toml
  • flash/gigadevice/gigadevice.toml
  • flash/gigadevice/GD1.toml

No key may exist at multiple levels.

cascadetoml check can be used to validate much of this.

Installing from PyPI

To install for current user:

pip3 install cascadetoml

To install system-wide (this may be required in some cases):

sudo pip3 install cascadetoml

To install in a virtual environment in your current project:

mkdir project-name && cd project-name
python3 -m venv .env
source .env/bin/activate
pip3 install cascadetoml

Installing for development

cascadetoml uses flit for packaging. To install a development copy into your current venv do:

flit install -s --deps develop

After install, you simply edit the files in place and the venv will use the source files directly.

Contributing

Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.

Documentation

For information on building library documentation, please check out this guide.

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

cascadetoml-0.3.1.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

cascadetoml-0.3.1-py2.py3-none-any.whl (7.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file cascadetoml-0.3.1.tar.gz.

File metadata

  • Download URL: cascadetoml-0.3.1.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.25.0

File hashes

Hashes for cascadetoml-0.3.1.tar.gz
Algorithm Hash digest
SHA256 7488ad77198d337ed90868dfb0ef4a5653346952693637ed22f6acf0e33fa1be
MD5 8d95ce7e9a7998c80ce0f960cd7fa3e3
BLAKE2b-256 129568612fa95cef7dab0e9d433636389d0920038a518e5946f3c5b528e8673a

See more details on using hashes here.

File details

Details for the file cascadetoml-0.3.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for cascadetoml-0.3.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f29b695cd17634ae3cef5888ebacb609c8e6964f1481e7b462571e5478307f7d
MD5 eb8952ae79f3a31f40ad10cc39014275
BLAKE2b-256 cc25abd296c95285fa179b2c646e6225db1b71995ed6312a439061501aa6da8d

See more details on using hashes here.

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