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.3.0.tar.gz (35.1 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.3.0-py3-none-any.whl (24.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: penguin_dal-0.3.0.tar.gz
  • Upload date:
  • Size: 35.1 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.3.0.tar.gz
Algorithm Hash digest
SHA256 16b679b5a9fadb825b48c9dd58c779c1418757b9353c9085957d7340489d950d
MD5 b7b515b2e1d64108fb31a68742888f22
BLAKE2b-256 62686f695f62dfb569d50617a20bc2a83e104017ee23456e212c8db30cf75e3c

See more details on using hashes here.

Provenance

The following attestation bundles were made for penguin_dal-0.3.0.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.3.0-py3-none-any.whl.

File metadata

  • Download URL: penguin_dal-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 24.3 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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6f598d3131fcdffe1f1ab003f83d63952a1d5447bf8a2140e5a33d38a19085ca
MD5 cc919307a9c37a21723ca75352bb4e4b
BLAKE2b-256 e521536b0e26f426fe9e3921ead80c8605b02fda75254921af1d8e79205f69cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for penguin_dal-0.3.0-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