Skip to main content

Application configuration tool from the BAT project

Project description

Logo

BatConf

Configuration Management for Python projects, modules, applications, and microservices.

Stable Version Downloads Build Status Documentation Status

Python 3.9 Python 3.10 Python 3.11 Python 3.12 Python 3.13

Compose structured hierarchical configurations from multiple sources. Enable your code to adapt seemlessly to the current context. Allow users in different contexts to use the config source that works best for them.

  • Hierarchical priority: CLI > Environment > config file > module defaults
  • Provides builtin support for common config sources:
    • CLI args
    • Environment Variables
    • Config File (yaml)
    • Config classes with default values
  • Easily extendable, add new sources to serve your needs.
  • Set reasonable defaults, and override them as needed.
  • Designed for 12-factor applications (config via Environment Variables)

Users can create their own config sources by creating classes that satisfy batconf.source.SourceInterfaceProto (or subclass batconf.source.SourceInterface)

The config lookup order is determined by the SourceList instance, which can be adjusted to suit your needs.

Design Principles

  • Non-Intrusive Integration: BatConf can be seamlessly incorporated into existing projects with minimal code modifications.
    • imports from batconf can be isolated to a single source file
    • Config classes utilize stdlib dataclasses
  • Portability and Modularity: Modules (sub-modules or entire projects) that use batconf configuration should be easy to compose and refactor.
    • modules can be easily plugged in to other modules.
    • modules can be easily factored out (into new projects).

Professional Support

Tidelift Logo Professionally supported BatConf is now available.

Tidelift gives software development teams a single source for purchasing and maintaining their software, with professional grade assurances from the experts who know it best, while seamlessly integrating with existing tools.

Get supported BatConf with the Tidelift subscription

Example Configuration

Check out our Quick Start Guide

and the example project in tests/example/ which includes tests and documentation.

Install Instructions

Install the core package:

pip install .

Install with Yaml support:

pip install .[yaml]

Install with Toml support, for python<=3.11:

pip install .[toml]

Adding BatConf to your project requirements

[project]
dependencies = [
    'batconf',
]

Including optional extras, like Yaml:

[project]
dependencies = [
    'batconf[yaml]',
]

Dev Guide

Install dev dependencies (pytest, mypy, etc)

pip install --group=dev -e .

Security contact information

To report a security vulnerability, please use the Tidelift security contact. Tidelift will coordinate the fix and disclosure.

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

batconf-0.3.0.tar.gz (135.7 kB view details)

Uploaded Source

Built Distribution

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

batconf-0.3.0-py3-none-any.whl (33.5 kB view details)

Uploaded Python 3

File details

Details for the file batconf-0.3.0.tar.gz.

File metadata

  • Download URL: batconf-0.3.0.tar.gz
  • Upload date:
  • Size: 135.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for batconf-0.3.0.tar.gz
Algorithm Hash digest
SHA256 f7df19b329160d924edf022973014e41f341e1c695fe890b3cd2ae8a69beed1f
MD5 89b5d319ea446efb653fce61fd76e8bd
BLAKE2b-256 5ae060858de49bb12912efc07bd580a96367a24e4f9d0500750869465436a070

See more details on using hashes here.

File details

Details for the file batconf-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: batconf-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 33.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for batconf-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 21898390511c6889ee4cad8602442579eba81de36abeb3d6369c6d9ebf06fadf
MD5 527629175538a76e9d34bdb1d98fc923
BLAKE2b-256 b475afae4a42d5be3c050152b6b44cd640824efd702fb6fca9ad938e3c210c29

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