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 connectionsInfdbClient: thin psycopg2 client (queries, run SQL files)InfdbConfig: load/merge YAML config and resolve placeholdersInfdbLogger: stdout + file logging, with worker logger supportutils: misc helpers (env → DSN, atomic writes, quick SQL)
Install
uv pip install
Basic idea
- You write a YAML like
configs/choose-a-name.yml. - You create
InfDB("mytool"). - 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.
- InfDB facade: documentation/api/infdb.md
- Client: documentation/api/client.md
- Config: documentation/api/config.md
- Logger: documentation/api/logger.md
- Utils: documentation/api/utils.md
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f69a3fe9236589831e95dce64560008768ed4372b7ad6aa7cd638b7c98f2cc4
|
|
| MD5 |
a9dd7dba8c1887504d26ccca3b7d8542
|
|
| BLAKE2b-256 |
b61543fa37f22c605291bae7c27979a515f82ce823f12b585880cba503fc4804
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b3ca66016ce88e485f2885082d16af7bc9843e80636428f0a54d4cab89a29d5b
|
|
| MD5 |
b8464681e84747da72669244ecf8ef51
|
|
| BLAKE2b-256 |
c7b57bdafc5f9785733c3c2bed5b8adabf759dfa66c5a685260813ae18f12809
|