Skip to main content

pmdb_utils

Shared utilities for the Poorman Data Platform.

Starting archive processing

After every dataset for a source has landed successfully, start its archive flow through FastAPI and retain the returned Kestra execution ID:

from pmdb_utils import start_archive

execution_id = start_archive(
    branch="master",
    source_system="boliga",
)

Set FASTAPI_URL to the FastAPI base URL, for example http://p-ubuntu:1000. The request is fire-and-forget with respect to the archive flow: it returns after Kestra accepts the execution, without waiting for the flow to finish. Request failures are raised to the caller and are not automatically retried, avoiding duplicate archive executions after ambiguous timeouts.

PostgreSQL writes

PostgresDB reads the application connection from DATABASE_URL by default. Select DATABASE_URL_LOG explicitly when writing to the separate log database.

from pmdb_utils.dataacceslayer import PostgresDB

with PostgresDB.from_env("DATABASE_URL_LOG") as db:
    db.create_table(
        "public.worker_log",
        {
            "id": "BIGSERIAL PRIMARY KEY",
            "job_id": "TEXT NOT NULL",
            "status": "TEXT NOT NULL",
            "details": "JSONB",
        },
    )

    db.insert(
        "public.worker_log",
        {"job_id": "job-123", "status": "started", "details": {}},
    )
    changed = db.update(
        "public.worker_log",
        values={"status": "complete"},
        where={"job_id": "job-123"},
    )
    deleted = db.delete(
        "public.worker_log",
        where={"job_id": "job-123"},
    )

The update and delete methods require at least one equality condition and return the affected row count. Values are parameterized, table and column names are quoted, and dictionaries/lists are adapted for PostgreSQL JSON columns. Use bulk_insert for multiple rows and execute or transaction for complex SQL.

Publishing

Pull requests that change this package test it on Python 3.10 and 3.13, build both the source distribution and wheel, and validate their metadata. After the change is merged into master, the same artifacts are published to PyPI using Trusted Publishing.

Every published change must use a new version in pyproject.toml. After changing the version or dependencies, refresh and commit the lockfile:

uv lock

The PyPI project must trust this GitHub publisher:

  • Owner: saebod
  • Repository: poorman-dataplatform
  • Workflow: publish-pmdb-utils.yml
  • Environment: pypi

Metadata

Release files for pmdb-utils 0.5.63

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pmdb-utils 0.5.63
File Size Uploaded Provenance Actions
pmdb_utils-0.5.63.tar.gz 76.3 kB With provenance Details for pmdb_utils-0.5.63.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pmdb-utils 0.5.63
File Interpreter ABI Platform Actions
pmdb_utils-0.5.63-py3-none-any.whl Python 3 none any Details for pmdb_utils-0.5.63-py3-none-any.whl

Total release size: 98.3 kB

Release files / pmdb_utils-0.5.63.tar.gz

Download URL pmdb_utils-0.5.63.tar.gz
Size 76.3 kB
Tags Source
SHA-256 checksum
How to use checksums
8a3a865db2d9065bc1d7a46affd5bb2c1f2673cc6d7481796e5f0a90a8b77105
BLAKE2b-256 checksum
How to use checksums
0a71fbe5b340fe20d3958935e1354aa4f8803770e1060fa72d93fe28e4a65b2a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

Release files / pmdb_utils-0.5.63-py3-none-any.whl

Download URL pmdb_utils-0.5.63-py3-none-any.whl
Size 22.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bb6218bfbe00f77eae09cdd0a1afd750df019e32962d3af731161b96072085f1
BLAKE2b-256 checksum
How to use checksums
f15e04e5536e5f9ef234282aacec843e34c199f7009bba94ebfccf00f68f851d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

Security for pmdb-utils 0.5.63

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pmdb_utils-0.5.63.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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