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.

Supported dialects: PostgreSQL, SQLite, and DuckDB. SQLite and DuckDB are both file-based (no host needed) and need database_name set explicitly, with no implicit default.

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.1.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.1.0
File Size Uploaded Provenance Actions
oa_configurator-2.1.0.tar.gz 298.8 kB With provenance Details for oa_configurator-2.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 425.5 kB

Release files / oa_configurator-2.1.0.tar.gz

Download URL oa_configurator-2.1.0.tar.gz
Size 298.8 kB
Tags Source
SHA-256 checksum
How to use checksums
89e33ab58bd428081b1c1c8ce1b4ad7d4a7d4b4627bcbc20d8cd6502811f627c
BLAKE2b-256 checksum
How to use checksums
5a5ae1061864a6f9abc9c49e26ab84a51dfc8f40616906c853e01ccbc022b477
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 26, 2026.

Transparency log

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

Download URL oa_configurator-2.1.0-py3-none-any.whl
Size 126.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
44c2fc43cf01398e598fc4d0fd4b17f9a3090cc35b6a378cdaf8e40fbfab0a0a
BLAKE2b-256 checksum
How to use checksums
594438cdd910fe7544b118d7a5fc741417f1be0a4a95fdb754d8d5f3a016b9f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 26, 2026.

Transparency log

Security for oa-configurator 2.1.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for oa_configurator-2.1.0.tar.gz

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 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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