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/konfigure.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/konfigure.git
cd konfigure/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=konfigure

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

Building the Package

# Build the package
python -m build

# Install the built package
pip install dist/konfigure-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.1.tar.gz (8.9 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.1-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: konfigure-0.1.1.tar.gz
  • Upload date:
  • Size: 8.9 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.1.tar.gz
Algorithm Hash digest
SHA256 f32fcb35068cfc014496f77342e45645f0f3211db7af0303bb97030b15e9ec52
MD5 eb616e6c3676c55c118713af744fda4f
BLAKE2b-256 0019b15b2d6870947dc8b54ef817ded92460fb665f798389aba44e5469b3d6ee

See more details on using hashes here.

File details

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

File metadata

  • Download URL: konfigure-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.1 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4224444873af0ba778e2c23010c0eb3995f9bf4291c8a1f9ac079ca27f614410
MD5 894fddca6b1dcf50a61eac4ca2065f07
BLAKE2b-256 8b3782dac379a770d5850ee6bf52e15169b6ba12796e73abc34d20a87c941870

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