Skip to main content

Simple Python configuration file management.

Project description

https://api.travis-ci.org/louib/confirm.svg https://img.shields.io/pypi/v/confirm.svg

Simple Python configuration file management.

Confirm validates a configuration file (.INI or YAML format) against a YAML configuration schema.

Installation

$ pip install confirm

Example schema file

"system":
    "name":
        "required": true
        "description": "Name of the system associated with the server."
        "type": "str"
"http_server":
    "listen":
        "required": true
        "type": "str"
        "description": "Listening address of the HTTP server."
        "default": "localhost"
    "port":
        "required": true
        "type": "int"
        "default": 8088
        "description": "Port of the HTTP server."
"threading":
    "initial_pool_size":
        "description": "Initial number of threads in the thread pool."
        "type": "int"
        "default": 10
    "maximum_pool_size":
        "description": "Maximum number of threads in the thread pool."
        "type": "int"
        "default": 100
        "deprecated": true

Usage

$ confirm validate examples/confirm.yaml project.conf
Error   : Missing required section system.
Error   : Missing required section http_server.
Warning : Deprecated option maximum_pool_size is present in section threading!

Confirm can also be used for validation as a Python library:

from confirm.validator import validator_from_config_file
...

  result = validator_from_config_file(config_file_path, schema_file_path)
  result.validate()
  print(result.is_valid())

License

MIT License.

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

confirm-0.1.3.tar.gz (5.9 kB view details)

Uploaded Source

File details

Details for the file confirm-0.1.3.tar.gz.

File metadata

  • Download URL: confirm-0.1.3.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for confirm-0.1.3.tar.gz
Algorithm Hash digest
SHA256 1719166c764d2c73716f754daf5be600d50cfb1247c968a7b69726d60579fc6b
MD5 e92249f9eb38e9bd2dc2dd82b3696065
BLAKE2b-256 b799589580700c1a67110a4bf999bb13f5a232fe2b9dcd5ef674dc6d060fae22

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