Skip to main content

SQLAlchemy runtime wrapper with PyDAL ergonomics for Penguin Tech applications

Project description

penguin-dal

PyDAL-style database abstraction layer built on SQLAlchemy. One schema (reflected automatically), one query interface — no more defining tables twice.

Installation

pip install penguin-dal

# With database drivers:
pip install penguin-dal[postgresql]   # psycopg2
pip install penguin-dal[asyncpg]      # asyncpg for async
pip install penguin-dal[mysql]        # PyMySQL
pip install penguin-dal[all]          # all drivers

Quick Start

from penguin_dal import DB

db = DB("postgresql://user:pass@localhost/mydb")

users = db(db.users.active == True).select()
pk = db.users.insert(email="new@example.com", name="New User", active=True)
db(db.users.id == pk).update(name="Updated")
db(db.users.id == pk).delete()

Read/Write Splitting

from penguin_dal import DatabaseManager

manager = DatabaseManager(
    write_url="postgresql://primary/myapp",
    read_url="postgresql://replica/myapp",
)
rows = manager.read(manager.read.users).select()
manager.write.users.insert(name="Alice")
manager.close()

📚 Full documentation: docs/penguin-dal/

License

AGPL-3.0 — Penguin Tech Inc

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

penguin_dal-0.2.1.tar.gz (28.6 kB view details)

Uploaded Source

Built Distribution

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

penguin_dal-0.2.1-py3-none-any.whl (20.1 kB view details)

Uploaded Python 3

File details

Details for the file penguin_dal-0.2.1.tar.gz.

File metadata

  • Download URL: penguin_dal-0.2.1.tar.gz
  • Upload date:
  • Size: 28.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for penguin_dal-0.2.1.tar.gz
Algorithm Hash digest
SHA256 52caa11e9eef65041bf996113e1ca7195ea4a078d780e11b3bb3fed4011f4a6e
MD5 2087a6f284a67ab243da15213f62e13b
BLAKE2b-256 c2f14344fe2933aa4fd00578e4e91ea106ceb56cae16b833aa43513fd7193933

See more details on using hashes here.

Provenance

The following attestation bundles were made for penguin_dal-0.2.1.tar.gz:

Publisher: publish.yml on penguintechinc/penguin-libs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file penguin_dal-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: penguin_dal-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 20.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for penguin_dal-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d750532f956c663e195fd1d1512b2b523b249e3ba11243282e58630e78690bf7
MD5 76c17c0fd57377d02fb8b5b50aef24e0
BLAKE2b-256 21f50f747577831b2fbea9013c665d720cd439ca4367be3d81af607a4cddb833

See more details on using hashes here.

Provenance

The following attestation bundles were made for penguin_dal-0.2.1-py3-none-any.whl:

Publisher: publish.yml on penguintechinc/penguin-libs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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