Skip to content

Latest commit

 

History

History
84 lines (58 loc) · 1.66 KB

README.md

File metadata and controls

84 lines (58 loc) · 1.66 KB

@configu/py

Configu SDK for Python

Install

To install the this package, simply type install configu using pip:

pip install configu

Usage

import os

import configu

config_store = configu.InMemoryConfigStore()
test_set = configu.ConfigSet("test")
schema = configu.ConfigSchema("get-started.cfgu.json")

configu.UpsertCommand(
  store=config_store,
  set=test_set,
  schema=schema,
  configs={
    "GREETING": "hello",
    "SUBJECT": "configu python sdk",
  },
).run()

data = configu.EvalCommand(
  store=config_store, set=test_set, schema=schema
).run()

configuration_data = configu.ExportCommand(data=data).run()

print(os.environ["MESSAGE"])
# hey, configu python sdk!
print(configuration_data)
# {'GREETING': 'hey', 'SUBJECT': 'configu python sdk', 'MESSAGE': 'hey, configu python sdk!'}

Reference

See oss.configu.com/py

Contributing

Requirements

  1. Follow the Development section from the CONTRIBUTING.md.
  2. Install pyenv | Homebrew
  3. Install poetry | Homebrew

Setup

Run these commands in order:

cd py
pyenv install
pyenv local 3.9.16
poetry env use $(pyenv which python)
poetry install

Contribute

Follow the Sending a Pull Request section from the CONTRIBUTING.md.