Skip to main content

adorm

adorm (asynchronous database ORM, pronounced "adore") is an asynchronous ORM for Python. Applications build queries and model operations with adorm's API; a driver executes them natively on PostgreSQL (asyncpg) or through an existing ORM (Django). The API is modelled on the Django ORM.

The package is pre-release; the API reference on the documentation site lists what it provides.

Requirements

  • Python 3.11 or newer
  • PostgreSQL for the test suite
  • the conformance run on SQLite needs no database server (Python's sqlite3)

Development

The project uses uv.

uv sync
uv run ruff check .
uv run ruff format --check .
uv run pytest

The tests read the test database URL from ADORM_TEST_DATABASE_URL (default postgres://postgres@127.0.0.1:5432/adorm_test). On that server they create and drop the database it names (<name>: ADORM_TEST_DATABASE_NAME when set, adorm_test when the URL names postgres or none) and the databases <name>_demo, <name>_demo_owner, <name>_limited, <name>_parallel and <name>_parallel_<n> (the clones of manage.py test --parallel). Other databases and the server's roles are left untouched; runs with different names on one server leave each other's databases alone. A run that leaves any of these databases, or a role named <name>_…, on the server fails. Run the tests as a dedicated user with CREATEDB. Under a superuser the test of the pool's refusal handling is skipped, because a database's connection limit does not apply to a superuser, and so are the tests of the demo, which refuses a superuser:

CREATE ROLE adorm LOGIN CREATEDB PASSWORD '...';

ADORM_TEST_CREATE_ROLES=1 also runs the tests of the role connection option. They create and drop the roles <name>_login, <name>_alice and <name>_bob and need CREATEROLE. Roles belong to the whole server and outlive the test databases: set the variable only on a server dedicated to the tests. CI runs the suite with CREATEDB only, then grants CREATEROLE and runs these tests separately.

The demo reads its database URL from ADORM_DEMO_DATABASE_URL. Both variables can be set in .env in the repository root (ignored by git; .env.example lists them). Variables set in the environment take precedence.

cp .env.example .env    # then fill in the user and password
uv run pytest

The conformance suite also runs the Django driver on SQLite, in a database file in a temporary directory, without PostgreSQL:

uv run pytest --ds=tests.djangoproject.settings_sqlite tests/conformance

Demo

demo.py runs the demo application, a library on PostgreSQL: every example and concurrency scenario on every available driver, with the adorm code, the SQL each driver sent, the result and the time side by side.

Open in GitHub Codespaces

The codespace runs the demo with a PostgreSQL server of its own.

  • demo/backend: a Django project with the app library;
  • demo/models: the adorm models generated from it;
  • demo/api: a FastAPI app running the examples and scenarios;
  • demo/frontend: the Vue frontend; demo/e2e: its Playwright tests.

It creates (owned by the user of ADORM_DEMO_DATABASE_URL, which must not be a superuser), migrates and seeds the demo database, then serves the API and the Vite dev server on http://127.0.0.1:5173/.

npm install
uv run python demo.py
npm run test:e2e

Documentation

The documentation site is in docs/ (VitePress, published on docs.velis.si):

npm install
npm run docs:dev

Licence

MIT, see LICENSE.

Metadata

Release files for adorm 0.0.1

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

Source distribution (sdist)

Source distribution for adorm 0.0.1
File Size Uploaded Provenance Actions
adorm-0.0.1.tar.gz 281.7 kB Without provenance Details for adorm-0.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for adorm 0.0.1
File Interpreter ABI Platform Actions
adorm-0.0.1-py3-none-any.whl Python 3 none any Details for adorm-0.0.1-py3-none-any.whl

Total release size: 593.5 kB

Release files / adorm-0.0.1.tar.gz

Download URL adorm-0.0.1.tar.gz
Size 281.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f6ae540bbe63c0afa8add3a2503cd16515d98a07746bb1b5721aa2314febd8ae
BLAKE2b-256 checksum
How to use checksums
63fe3cf3b48407deeeb9e5a099c23e8746ce111f6358f7414f8407310643a0b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / adorm-0.0.1-py3-none-any.whl

Download URL adorm-0.0.1-py3-none-any.whl
Size 311.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
253239f4dd89d36609fe54d1ad57f84b7d61abc6f1b573f7c91add07b16069e5
BLAKE2b-256 checksum
How to use checksums
d91f97b686892afb51e92f28ee40cc9e62efbb20270d5645663aa334b8de7973
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for adorm 0.0.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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