Skip to main content

InfDB wrapper for python

Project description

InfDB Python Wrapper

A tiny helper layer around PostgreSQL for “InfDB” projects. It gives you:

  • InfDB: one entry point for config + logging + DB connections
  • InfdbClient: thin psycopg2 client (queries, run SQL files)
  • InfdbConfig: load/merge YAML config and resolve placeholders
  • InfdbLogger: stdout + file logging, with worker logger support
  • utils: misc helpers (env → DSN, atomic writes, quick SQL)

Install

uv pip install

Basic idea

  1. You write a YAML like configs/choose-a-name.yml.
  2. You create InfDB("mytool").
  3. You call .connect() or .get_db_engine().

Example

from infdb.infdb import InfDB

infdb = InfDB("mytool", config_path="configs")

# psycopg2 client
with infdb.connect("postgres") as db:
    rows = db.execute_query("SELECT now()")
    print(rows)

# SQLAlchemy engine
engine = infdb.get_db_engine("postgres")
with engine.connect() as conn:
    print(conn.execute("SELECT 1").scalar())

Functionality documentation

The core package documentation is generated automatically as Markdown pages.
These pages describe the public API and behavior of each main module in the infdb package.

How this documentation is generated

These “functionality” pages are not maintained manually. They are produced by the documentation automation scripts (API markdown generation → MkDocs build → export).

The steps and commands to generate/update them are documented here:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

infdb-0.1.1.tar.gz (19.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

infdb-0.1.1-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file infdb-0.1.1.tar.gz.

File metadata

  • Download URL: infdb-0.1.1.tar.gz
  • Upload date:
  • Size: 19.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.0

File hashes

Hashes for infdb-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3f69a3fe9236589831e95dce64560008768ed4372b7ad6aa7cd638b7c98f2cc4
MD5 a9dd7dba8c1887504d26ccca3b7d8542
BLAKE2b-256 b61543fa37f22c605291bae7c27979a515f82ce823f12b585880cba503fc4804

See more details on using hashes here.

File details

Details for the file infdb-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: infdb-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 14.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.0

File hashes

Hashes for infdb-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b3ca66016ce88e485f2885082d16af7bc9843e80636428f0a54d4cab89a29d5b
MD5 b8464681e84747da72669244ecf8ef51
BLAKE2b-256 c7b57bdafc5f9785733c3c2bed5b8adabf759dfa66c5a685260813ae18f12809

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page