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

Uploaded Python 3

File details

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

File metadata

  • Download URL: oa_configurator-1.1.0.tar.gz
  • Upload date:
  • Size: 173.4 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.1.0.tar.gz
Algorithm Hash digest
SHA256 251986a616e698e3b0b273f2a9428652af79fd3975dc4dd19898f96d89bf34ad
MD5 3ca7ca2955d69f11d47447f2fbfb6ada
BLAKE2b-256 16a5d06e75e97281952981c75d31f3befc314f39c08c74e51952b7f363f36de0

See more details on using hashes here.

Provenance

The following attestation bundles were made for oa_configurator-1.1.0.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.1.0-py3-none-any.whl.

File metadata

  • Download URL: oa_configurator-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 60.7 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6af25c970338460677c4426b2ae84e870c202b758f71562440f98def227d39ef
MD5 d9aa4d2371411b93652cbb8259cf72cb
BLAKE2b-256 6b5bf3b600f3e2b6acc7c74271b12eb31cfe83d223ed28f80efa6edfd5e99d0f

See more details on using hashes here.

Provenance

The following attestation bundles were made for oa_configurator-1.1.0-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

1.2.1

2 files

1.2.0

2 files

This release

1.1.0 This release

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