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.0.tar.gz (182.3 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.0-py3-none-any.whl (64.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: oa_configurator-1.2.0.tar.gz
  • Upload date:
  • Size: 182.3 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.0.tar.gz
Algorithm Hash digest
SHA256 c10e76cbf6211b2b29fae48acc1791c6986cb3db76ed58565d04cbdd2d05cad8
MD5 440972fe8382da82a136d30883772f2d
BLAKE2b-256 b53fc643124c59c712bf856276b0875eca07f2ddf05ea49ca4c3b810c5963471

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: oa_configurator-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 64.0 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a4319073173fb2825992c98dc76dbd33419a474ca8562162da50ccc391fcc1dc
MD5 c1f52546a305779e59aac91659191e6f
BLAKE2b-256 e6b6d2e466aa1070473374e773507744377c356cc2a5fe634ef843b346a366a4

See more details on using hashes here.

Provenance

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

This release

1.2.0 This release

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