Skip to content

1.1.0

Compare
Choose a tag to compare
@GilbN GilbN released this 28 Jan 21:01
· 10 commits to main since this release

1.1.0 - 2024-01-28

New Release: v1.1.0 - True Nested Configuration Attribute Access

This release introduces a significant new feature: Nested Configuration Attribute Access.

What's New

Nested Configuration Attribute Access: In previous versions, accessing and updating nested configuration values required dictionary-style access. With this release, we've made it easier and more intuitive to work with nested configuration values. Now, you can access and update these values using attribute-style access, similar to how you would interact with properties of an object in JavaScript.

Here's an example:

from simple_toml_configurator import Configuration

# Define default configuration values
default_config = {
    "app": {
        "ip": "0.0.0.0",
        "host": "",
        "port": 5000,
        "upload_folder": "uploads"
    },
    "mysql": {
        "databases": {
            "prod": "db1",
            "dev": "db2"
        }
    }
}

# Initialize the Simple TOML Configurator
settings = Configuration()
settings.init_config("config", default_config, "app_config")

# Access nested configuration values
print(settings.mysql.databases.prod)  # Output: 'db1'
settings.mysql.databases.prod = 'new_value'
settings.update()
print(settings.mysql.databases.prod)  # Output: 'new_value'

See Usage examples for more information.

Full Changelog: 1.0.1...1.1.0