Skip to main content

configistate

A useful config file utility.

A configuration utility that provides a consistent, robust framework for incorporating configuration files in software projects.

Features

  • Python Library: Import configistate into your projects for programmatic config management
  • CLI Tool: Use confy command-line tool for working with config files
  • TOML Support: Full support for TOML configuration files
  • File Variables: Support for file:// path variables to read file contents
  • Aliases: Define config file aliases in ~/.confy.rc for easy access

Installation

# Install from source
make build
make install

# Or install in development mode
make build

Python Library Usage

from configistate import Config

# Load a config file
config = Config('config.toml')

# Get values
database_host = config.get('database.host')
debug_mode = config.get('debug', False)

# Set values
config.set('database.port', 5432)
config.save()

# List sections and variables
sections = config.list_sections()
variables = config.list_variables('database')

File Variables

Config files can reference external files using file:// URLs:

[secrets]
api_key = "file:///path/to/secret.txt"

The library will automatically read the file content and substitute it as the variable value.

CLI Tool Usage

The confy command provides a command-line interface:

# List all sections
confy config.toml --list

# List variables in a section
confy config.toml --list database

# Get a configuration value
confy config.toml --get database.host

# Set a configuration value
confy config.toml --set database.port 5432

Aliases

Define aliases in ~/.confy.rc:

[aliases]
myapp = "/path/to/myapp/config.toml"

Then use the alias:

confy myapp --get database.host

Development

# Setup development environment
make build

# Run tests
make test

# Run linting
make fmt

# Build documentation
make doc

# Create distribution package
make dist

Requirements

  • Python 3.8+
  • TOML support

License

MIT License - see LICENSE file for details.

Metadata

Release files for configistate 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for configistate 1.0.0
File Size Uploaded
configistate-1.0.0.tar.gz 10.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for configistate 1.0.0
File Interpreter ABI Platform
configistate-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 19.0 kB

Release files / configistate-1.0.0.tar.gz

Download URL configistate-1.0.0.tar.gz
Size 10.9 kB
Tags Source
SHA-256 checksum
How to use checksums
53f6984de52addf55c68028ce3f4cd6c4374b3050f32729fb6ebd0c273e1fc72
BLAKE2b-256 checksum
How to use checksums
b4e6d0a9981f02eb4c43fc0c5ec3a7c1da3e3f7ce28dd7fa727554554c33aeb0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.13

Release files / configistate-1.0.0-py3-none-any.whl

Download URL configistate-1.0.0-py3-none-any.whl
Size 8.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
00f4f8bd9253f77c55c1ab7ed29a1345b13bdab371cf4336df328b4d69a593d1
BLAKE2b-256 checksum
How to use checksums
ed6ce1ef91dc799860afae1f9380d9afdbc98a619e486290cffb71a1657b2dab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.13

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page