Skip to main content

TOML file reader - python module to read/write toml configuration files

Project description

TOML file reader - python module to read/write toml configuration files

  • Files can be loaded and saved completed with comments and formating

  • Configuration files can be templated and values validated on load or value changes

Two interaces:

Simple dictionaries {key: value}
  • data dictionary with nested dictionary with {key: value}

  • template dictionary with comments/type information

  • template allows type, min/max and other validators to be set and stores comments

  • use load/save functions to open/save to file.

Config object interface:
  • allows seamless use of template/data via custom dictlike interface

  • use cfg = Config(filename) to open

  • access subtables/keys via exteneded key indexing e.g. cfg[‘Table1.subtable.key’] = 1

  • if a template has been set any value will be validated when it is set.

  • if a template has been set any missing values will return the defualt and be created.

  • use cfg.save(filename) to save

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

toml_file-1.0.5.tar.gz (22.3 kB view hashes)

Uploaded Source

Built Distribution

toml_file-1.0.5-py2.py3-none-any.whl (23.0 kB view hashes)

Uploaded Python 2 Python 3

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