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")
primary, vocab = database.create_engines()   # SQLAlchemy Engines, 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", cdm_schema="omop")},
)
primary, vocab = Resolver(config).resolve_database("cdm_db").create_engines()

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/

Metadata

Release files for oa-configurator 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for oa-configurator 2.0.0
File Size Uploaded
oa_configurator-2.0.0.tar.gz 278.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for oa-configurator 2.0.0
File Interpreter ABI Platform
oa_configurator-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 396.4 kB

Release files / oa_configurator-2.0.0.tar.gz

Download URL oa_configurator-2.0.0.tar.gz
Size 278.4 kB
Tags Source
SHA-256 checksum
How to use checksums
26406e90aeadd4c747646763b80f16025c4c6638afec687517788bc537d0d581
BLAKE2b-256 checksum
How to use checksums
e96264bf398b8fe381d138446199be69bc437ef93fdb70aab48cebf51467f6ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release files / oa_configurator-2.0.0-py3-none-any.whl

Download URL oa_configurator-2.0.0-py3-none-any.whl
Size 118.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2186beb5567850ba5bfe4950c2820b909d3746c6fa233a6074a85396a343af35
BLAKE2b-256 checksum
How to use checksums
069b99f0073d97de3545d48cf28c8f39b724d543baf83e8af8d0ba5c8bffbb01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

1.3.0

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release 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