Skip to main content

A native Python parser for the Erbsland Configuration Language (ELCL)

Project description

Erbsland Configuration Parser for Python

Welcome to the implementation of the Erbsland Configuration Language Parser—a modern and robust configuration parser built for Python 3.12 and beyond. This implementation is designed to be secure, minimal in dependencies, and easy to integrate into your existing projects.

All you need is a Python 3.12 or newer – there are no external dependencies, no hassle.

Project Status

  • Fully implements the Erbsland Configuration Language.
  • Thoroughly tested and stable for use in productive development.
  • The API is stable.
  • The documentation covers the most important features.

Installation

pip install erbsland-conf

Quick Start

Minimal Example:

import erbsland.conf as elcl
doc = elcl.load("config.elcl")
print(doc.get_int("server.port"))

A More Realistic Example:

import erbsland.conf as elcl

def parse_configuration(file_name: str):
    doc = elcl.load(file_name)
    # Access required values and check the type.
    server_name = doc.get_text("main.server.name")
    # Provide a default if the value is optional.
    port = doc.get_int("main.server.port", default=8080)
    # Iterating over section lists naturally.
    for client_value in doc["client"]:
        name = client_value.get_text("name")
        ip = client_value.get_text("ip")
        port = client_value.get_int("port", default=9000)

        # Reading values from optional sections.
        if filter_value := client_value.get("filter", default=None):
            # Requiring lists of specific types.
            keywords = filter_value.get_list("keywords", str)
            # ...
        # ...
    # ...

def main():
    try:
        parse_configuration("quick-intro.elcl")
        # ... running the application ...
        exit(0)
    except elcl.Error as e:
        print("Error reading the configuration.")
        print(e.to_text(elcl.ErrorOutput.FILENAME_ONLY | elcl.ErrorOutput.USE_LINES))
        exit(1)

if __name__ == "__main__":
    main()

Documentation

Please read the documentation for more information about the parser and its features:

👉 Erbsland Configuration Parser Documentation

About the Erbsland Configuration Language

The Erbsland Configuration Language is a human-friendly format designed for writing clear and structured configuration files. It combines a strict, well-defined syntax with flexibility in formatting, making configurations easier to read and maintain.

Here’s an example of a configuration file in a more descriptive style:

# Comments are allowed almost everywhere.
---[ Main Settings ] -------------------- # A section 
App Name : "ELCL Demo"                    # Name-Value Pair with Text Value
Version  : 1                              # Name-Value Pair with Integer Value

And the same data in a minimal style:

[main_settings] 
app_name: "ELCL Demo"
version: 1

Supported data types include text, integer, floating-point, boolean, date, time, datetime, time-delta, regular expressions, code, and byte sequences. These can be grouped into sections, nested via name paths, or organized into lists.

A detailed language specification is available here:

👉 Erbsland Configuration Language Documentation

Requirements

  • Python 3.12 or newer.

License

Copyright © 2025 Tobias Erbsland / Erbsland DEV – https://erbsland.dev/

Licensed under the Apache License, Version 2.0. You may obtain a copy at: http://www.apache.org/licenses/LICENSE-2.0 Distributed on an “AS IS” basis, without warranties or conditions of any kind. See the LICENSE file for full details.

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

erbsland_conf-1.0.6.tar.gz (165.1 kB view details)

Uploaded Source

Built Distribution

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

erbsland_conf-1.0.6-py3-none-any.whl (98.9 kB view details)

Uploaded Python 3

File details

Details for the file erbsland_conf-1.0.6.tar.gz.

File metadata

  • Download URL: erbsland_conf-1.0.6.tar.gz
  • Upload date:
  • Size: 165.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for erbsland_conf-1.0.6.tar.gz
Algorithm Hash digest
SHA256 0d76cf00fcfcea48ec3a930439d85b96129ab5a14c6cca20b72c4e5fffbfbe57
MD5 0467b80cdd6bab55b846406c4063366e
BLAKE2b-256 f7af1a4aeb0d684f020b6641305e85b951de839602cf1b8d9788cc00b72e73e3

See more details on using hashes here.

Provenance

The following attestation bundles were made for erbsland_conf-1.0.6.tar.gz:

Publisher: publish.yml on erbsland-dev/erbsland-py-conf

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file erbsland_conf-1.0.6-py3-none-any.whl.

File metadata

  • Download URL: erbsland_conf-1.0.6-py3-none-any.whl
  • Upload date:
  • Size: 98.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for erbsland_conf-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 ddbd0793bcb923b2445f3bb7d0aa867416ab2c8905e10c748bf57caa0f929263
MD5 3dcc4983b0cdb5d11012f6db9ed5b52a
BLAKE2b-256 689fb139c007c627dbd1f0261255a30c4b140b6339ac7e6806817863deda6be6

See more details on using hashes here.

Provenance

The following attestation bundles were made for erbsland_conf-1.0.6-py3-none-any.whl:

Publisher: publish.yml on erbsland-dev/erbsland-py-conf

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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