Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 1.2.1 instead.
Reason given by maintainers: Incorrect tags

PyPI - Downloads

Comprehensive Configuration

A simple configuration library that lets you create a pydantic-like model for your configuration.

Installation

pip install comprehensiveconfig

Features

  • Supports static type checking
  • toml writer
  • json writer
  • Number Fields
  • Text Fields (with regex filtering)
  • List fields
  • Table fields
  • TableSpec (Model) fields
  • Sections
  • Include doc comments in Section
  • auto loading
  • initialize default config (with auto loader)
  • yaml writer
  • Tests targetting mypy and other static type checkers to ensure EVERYTHING looks good across IDE's
  • section list (via a Table field)
  • Field type unions (overwriting normal union syntax)
  • per attribute doc comments (inline and noninline)
  • enum support (Via spec.ConfigEnum and python's enum.Enum)
  • fully supported string escapes

Example (Python)

# example.py
from comprehensiveconfig import ConfigSpec
from comprehensiveconfig.spec import Section, Integer, Float, Text, List
from comprehensiveconfig.toml import TomlWriter

class MyConfigSpec(ConfigSpec,
                   default_file="myconfig.toml",
                   writer=TomlWriter,
                   create_file=True):
    class MySection(Section, name="My_Section"):
        some_field = Integer(10)
        other_field = Text("Some Default Text")

        class SubSection(Section):
            '''An example Sub Section'''
            x = Integer(10)

    class Credentials(Section):
        '''Example credentials section'''
        email = Text("example@email.com", regex=r"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$")
        password = Text("MyPassword")

    some_field = Float(6.9)
    list_of_stuff = List(["12", "13", "14"], inner_type=Text())


# Accessing values from globally loaded config (if one exists, otherwise it accesses the actual Field class)
print(MyConfigSpec.some_field)
print(MyConfigSpec.MySection.other_field)

# Another way to open configuration
second_config = MyConfigSpec.load("another_config.toml", TomlWriter)

Example (toml output)

some_field = 6.9
list_of_stuff = ["12", "13", "14"]

[My_Section]
some_field = 10
other_field = "Some Default Text"

[My_Section.SubSection]
# An example Sub Section
x = 10

[Credentials]
# Example credentials section
email = "example@email.com"
password = "MyPassword"

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

comprehensiveconfig-1.1.4.tar.gz (22.4 kB view details)

Uploaded Source

Built Distribution

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

comprehensiveconfig-1.1.4-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

File details

Details for the file comprehensiveconfig-1.1.4.tar.gz.

File metadata

  • Download URL: comprehensiveconfig-1.1.4.tar.gz
  • Upload date:
  • Size: 22.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for comprehensiveconfig-1.1.4.tar.gz
Algorithm Hash digest
SHA256 0876c36287dde6e91de066c9a4c40bdd0d0b59189f92949da17b6573a8b89396
MD5 1d4184bce6e801c052a4da9d78ac9e15
BLAKE2b-256 8da5a8945db27ab417a870c0c4985d2f5b12f02aff0d6ac2dc0f8cf9dcb5b914

See more details on using hashes here.

File details

Details for the file comprehensiveconfig-1.1.4-py3-none-any.whl.

File metadata

  • Download URL: comprehensiveconfig-1.1.4-py3-none-any.whl
  • Upload date:
  • Size: 22.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for comprehensiveconfig-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a39fcba943b79b12b04cba3ef629a6725f3eded116e2c51232ed0dea88139099
MD5 d5583a87a1b42a1aeab1f7f338169b3c
BLAKE2b-256 8a89cc2caaf328f93843bec058f9036cc149498083f16ebfcf3d7011fff5898c

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