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.7.tar.gz (9.7 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.7-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for konfigure-0.1.7.tar.gz
Algorithm Hash digest
SHA256 4fbc97ae2dcccd1214e71a7ab96f35aa2db45d8af4c463ab4f9866c2d43321d3
MD5 4de0adb655c3b41d051bc15fb477957e
BLAKE2b-256 10b6400cc6ca9dca350188e3a7253d3910a53c404f925fd4ac926f4a14067683

See more details on using hashes here.

Provenance

The following attestation bundles were made for konfigure-0.1.7.tar.gz:

Publisher: workflow.yml on sunnybak/konfigure

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

File details

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

File metadata

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

File hashes

Hashes for konfigure-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 8d44935efd18808ebb2bfdac2423d6aec20ec0b7863038ef0ada15d7a517177a
MD5 7a260f12f558ad1b24106d294e93f528
BLAKE2b-256 12775f0b72a46ca4d304b1079c4472e8ca08154cec5ae903823284e73b926e70

See more details on using hashes here.

Provenance

The following attestation bundles were made for konfigure-0.1.7-py3-none-any.whl:

Publisher: workflow.yml on sunnybak/konfigure

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