Skip to main content

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

MIT — Penguin Tech Inc

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.4.0.tar.gz (63.5 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.4.0-py3-none-any.whl (49.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: penguin_dal-0.4.0.tar.gz
  • Upload date:
  • Size: 63.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for penguin_dal-0.4.0.tar.gz
Algorithm Hash digest
SHA256 98c08ec55649aaedb73f85b303c3de2860c0858fec04a381f026e3b361074351
MD5 6e86679913b8e5e695f02778ee3b39af
BLAKE2b-256 c26fbee1f120c2c55076cf8af19f5aeb1099efbd634a29507f6b180ee1570f3d

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: penguin_dal-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 49.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for penguin_dal-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 91c8a6e9f12b911d8eff4a018095a563be81a781d0eaa9b399ea31e7898aacf8
MD5 9c9bc3476edc528f01e9d5b758ab9fd3
BLAKE2b-256 315ce514156b16b78e4b94a6418e750b7d647c55cb016b6dc253b419f657d750

See more details on using hashes here.

Provenance

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

Release history Release notifications | RSS feed

0.4.1

2 files

This release

0.4.0 This release

2 files

0.3.0

2 files

0.2.1

2 files

0.1.0

2 files

Supported by

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