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.0.0.tar.gz (156.0 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.0.0-py3-none-any.whl (52.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: oa_configurator-1.0.0.tar.gz
  • Upload date:
  • Size: 156.0 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.0.0.tar.gz
Algorithm Hash digest
SHA256 5ab2a0ba7d2b723312e02422a937047a792c3cba1c4ae59fbd4df53ec0955209
MD5 92edd0fd8b844ed9522a17d0c93df4f3
BLAKE2b-256 0dbf8934b30a7ffb24b17dd05fe39a85cf30d47123e3cbe093ce964797a33a43

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: oa_configurator-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 52.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.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9e3ae9e904bdf92201c22df851b8bcc47ad66f206a8fafcd79875b7b27670beb
MD5 226e3a424990a5609335c816568df550
BLAKE2b-256 f68430fd96eb7a83e9e6ef0d911e402002c3ece45541a8d7892be2799152b114

See more details on using hashes here.

Provenance

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

1.1.0

2 files

This release

1.0.0 This release

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