Skip to main content

oa-configurator

oa-configurator is a shared configuration layer for the OMOP-oriented Python stack: one typed config.toml file instead of a tangle of environment variables and package-local .env files.

Core concepts

  • Connection: a concrete database endpoint (dialect, host, credentials)
  • Database: a named database built on a connection, one of two kinds: a plain generic database, or a CDM database with its vocab/results role bundle
  • Provider / Model: the same two-tier pattern as Connection/Database, for LLM and embedding backends
  • Vector Store: which storage backend an embedding-capable package should use, pointing at a generic database
  • Tool: per-package settings, e.g. which database/model/vector store a package uses

A consuming package subclasses PackageConfigBase, declares its fields with RefTo(...) to name entries in the sections above, and registers via a pyproject.toml entry point. omop-config configure <package> then discovers it and interactively resolves or creates whatever it needs.

Install

pip install oa-configurator

Example

from oa_configurator import load_stack_config, Resolver

config = load_stack_config()          # OA_CONFIG_PATH is read at import; set it before process startup
resolver = Resolver(config)

database = resolver.resolve_database("cdm_db")
engine = database.create_engine()     # SQLAlchemy Engine, schema_translate_map applied

Or without a file, for tests and scripts:

from oa_configurator import StackConfig, ConnectionConfig, CDMDatabaseConfig, Resolver

config = StackConfig.for_session(
    connections={"local": ConnectionConfig(dialect="postgresql+psycopg", host="localhost",
                                            database_name="omop", password="omop")},
    databases={"cdm_db": CDMDatabaseConfig(connection="local", schema_name="omop")},
)
engine = Resolver(config).resolve_database("cdm_db").create_engine()

Security

Passwords and API keys are currently stored in plaintext. Restrict file permissions:

chmod 600 ~/.config/omop/config.toml

secret_source (env-var- and file-backed credential lookup, keeping secrets out of the TOML file entirely) is planned but not yet implemented; see Secrets.

Docs

Full documentation, including the config file reference, CLI usage, and package-integration guide: https://AustralianCancerDataNetwork.github.io/oa-configurator/

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

oa_configurator-1.2.1.tar.gz (182.9 kB view details)

Uploaded Source

Built Distribution

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

oa_configurator-1.2.1-py3-none-any.whl (64.2 kB view details)

Uploaded Python 3

File details

Details for the file oa_configurator-1.2.1.tar.gz.

File metadata

  • Download URL: oa_configurator-1.2.1.tar.gz
  • Upload date:
  • Size: 182.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for oa_configurator-1.2.1.tar.gz
Algorithm Hash digest
SHA256 50828dc2490e533ac535d2bf5f008c61a5962095283d2f98d9041f4e40b769e2
MD5 231a98989dc190fd5808cadfefcc10e9
BLAKE2b-256 076f126bb395080255cca45cd173aec1903aa13f8fc6b153ba5fce760371e1dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for oa_configurator-1.2.1.tar.gz:

Publisher: publish.yml on AustralianCancerDataNetwork/oa-configurator

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

File details

Details for the file oa_configurator-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: oa_configurator-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 64.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for oa_configurator-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 707a1c321245e2eb6d62e5a9acf81c1145291edb5ace83489d0d726e05291ad0
MD5 894dc7b53895f430d5d97815aca128b3
BLAKE2b-256 e4c09246c3948f1f8e62e6e6865d050a961111fb0720f53daceaf77a9a9bb80e

See more details on using hashes here.

Provenance

The following attestation bundles were made for oa_configurator-1.2.1-py3-none-any.whl:

Publisher: publish.yml on AustralianCancerDataNetwork/oa-configurator

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

Release history Release notifications | RSS feed

This release

1.2.1 This release

2 files

1.2.0

2 files

1.1.0

2 files

1.0.0

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 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