Skip to main content

A YAML-based configuration management tool for separating code from prompts in LLMs

Project description

Konfigure

A YAML-based configuration management tool for separating code from prompts in LLMs.

Installation

# Install from PyPI
pip install konfigure

# Install from source
pip install git+https://github.com/sunnybak/confiture.git#subdirectory=python

Usage

import konfigure

# Load a YAML file
config = konfigure.load('config.yaml')

# Access values using dot notation
print(config.a.b)  # Prints the value of b in the a section

# Set values
config.a.b = 'new value'
config.new_section = {'key': 'value'}

# Render Jinja2 templates
template_value = config.a.b.render(variable='value')

# Save changes back to the file
konfigure.dump(config, 'config.yaml')

Features

  • Load YAML configuration files into memory
  • Access configuration values using dot notation
  • Modify configuration values in memory
  • Render string values as Jinja2 templates
  • Save configuration back to YAML files

Development

Local Setup

# Clone the repository
git clone https://github.com/sunnybak/confiture.git
cd confiture/python

# Install in development mode
pip install -e .

# Install development dependencies
pip install -e ".[dev]"

Running Tests

# Run all tests
pytest

# Run tests with coverage
pytest --cov=confiture

# Run a specific test file
pytest confiture/tests/test_core.py

Building the Package

# Build the package
python -m build

# Install the built package
pip install dist/confiture-0.1.0-py3-none-any.whl

License

MIT

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

konfigure-0.1.0.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

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

konfigure-0.1.0-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file konfigure-0.1.0.tar.gz.

File metadata

  • Download URL: konfigure-0.1.0.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for konfigure-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4a34ee75fd33afda22da3d6c5f004a24173f30b93cc62a91f20fa721418c5996
MD5 00bcd2a8542aed3681501b24c19dc9bb
BLAKE2b-256 49e87f592d9715ac7ff4971a6d6b763dd571699e28870fff38f66195de7bbf96

See more details on using hashes here.

File details

Details for the file konfigure-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: konfigure-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for konfigure-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 46b3bebd94deb2770ece92c81a33401ad72476db6e5f0e6edec59ca78fa63831
MD5 9cb91c990b0129ad10cbf60d8eb98aea
BLAKE2b-256 127d0c7205184eea1b0704862a2ef05d097ab78c1b27e0c4ed9279310013dfe9

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