Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Reason given by maintainers: renamed to aprisma

Prismaa

A Python Prisma client backed by SQLAlchemy — no Node.js or Rust at runtime.

Prismaa reads a standard schema.prisma file and generates a fully-typed async Python client. All queries run through SQLAlchemy Core — SQLite, PostgreSQL, and any other SQLAlchemy dialect work out of the box.

db = Prisma()
await db.connect("sqlite+aiosqlite:///dev.db")

alice = await db.user.create(data={"email": "alice@example.com", "name": "Alice"})

posts = await db.post.find_many(
    where={"author": {"email": "alice@example.com"}, "published": True},
    include={"author": True},
    order={"createdAt": "desc"},
)

await db.disconnect()

Why Prismaa?

The original prisma-client-py is no longer maintained and requires a Rust query engine and a Node.js subprocess at every query. Prismaa replaces that with a pure-Python SQLAlchemy layer — the Prisma CLI is only used during development to manage migrations, never at runtime.

prisma-client-py Prismaa
Runtime dependency Rust engine + Node.js None
Query layer Prisma Query Engine SQLAlchemy Core
Schema format Prisma schema Prisma schema
Async support Yes Yes
Type safety Yes Yes (Pydantic v2)

Features

  • Pure Python runtime — no Node.js process, no Rust binary, no subprocess at query time
  • Async-first — every method is async; built for asyncio
  • Fully typed — Pydantic v2 models, TypedDict query inputs, typed relation attributes
  • Prisma v7 schema — use the standard schema format and the official Prisma CLI for migrations
  • SQLAlchemy backend — JOIN-based relation filtering, correlated EXISTS subqueries, connection pooling
  • Rich query API — filtering, ordering, pagination (offset and cursor), distinct, include, select, transactions, raw queries, group_by aggregations

Installation

pip install prismaa

For PostgreSQL:

pip install "prismaa[postgresql]"

Prismaa uses the Prisma CLI (a Node.js tool) for schema migrations. It is only needed during development — see Prisma CLI Setup for a one-time setup guide.


Quick start

1. Write a schema

# schema.prisma

generator client {
  provider  = "prismaa"
  output    = "./prisma"
  interface = "asyncio"
}

datasource db {
  provider = "sqlite"
}

model User {
  id    Int    @id @default(autoincrement())
  email String @unique
  name  String
  posts Post[]
}

model Post {
  id        Int     @id @default(autoincrement())
  title     String
  content   String
  published Boolean @default(false)
  authorId  Int
  author    User    @relation(fields: [authorId], references: [id])
}

2. Push the schema and generate the client

# Push schema to the database (creates tables)
npx prisma db push --url "file:./dev.db"

# Generate the Python client
prismaa generate --schema schema.prisma

3. Use it

import asyncio
from prisma import Prisma

async def main():
    db = Prisma()
    await db.connect("sqlite+aiosqlite:///dev.db")

    # Create a user
    alice = await db.user.create(
        data={"email": "alice@example.com", "name": "Alice"}
    )

    # Create a post linked to that user
    post = await db.post.create(
        data={"title": "Hello world", "content": "My first post.", "authorId": alice.id},
        include={"author": True},
    )
    print(post.author.name)  # Alice

    # Filter posts through a related model
    posts = await db.post.find_many(
        where={"author": {"email": "alice@example.com"}},
        include={"author": True},
        order={"title": "asc"},
    )

    # Update
    await db.post.update(
        where={"id": post.id},
        data={"published": True},
    )

    # Count
    n = await db.post.count(where={"published": True})
    print(f"{n} published post(s)")

    # Delete
    await db.post.delete(where={"id": post.id})

    await db.disconnect()

asyncio.run(main())

Database support

Database Driver Install
SQLite aiosqlite included
PostgreSQL asyncpg pip install "prismaa[postgresql]"
Any SQLAlchemy dialect bring your own pass the URL to connect()

Documentation

Full documentation: xlaszlo.github.io/prismaa


Contributing

Found a bug or have a feature idea? Please open an issue on GitHub Issues with a minimal reproducible description of the problem or feature. Please do not open pull requests — a clear issue description is more useful than a PR without prior discussion.

Metadata

Release files for prismaa 0.1.4

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

Source distribution (sdist)

Source distribution for prismaa 0.1.4
File Size Uploaded
prismaa-0.1.4.tar.gz 136.7 kB Details

Built distribution (wheel)

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

Total release size: 167.2 kB

Release files / prismaa-0.1.4.tar.gz

Download URL prismaa-0.1.4.tar.gz
Size 136.7 kB
Tags Source
SHA-256 checksum
How to use checksums
963236785f50aad331c861988f31ca434ae82370deb4c6901e961376b5d9c5ec
BLAKE2b-256 checksum
How to use checksums
3e89818c50fd81e8e8a6ab1ed8443239ea6315078c486090b4604d93718d834e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 May 17, 2026.

Transparency log

Release files / prismaa-0.1.4-py3-none-any.whl

Download URL prismaa-0.1.4-py3-none-any.whl
Size 30.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
54bdeb4212530573003f977a83e3a2a17cebded7612b0b287abe8761ee1aa50e
BLAKE2b-256 checksum
How to use checksums
c2fcb55f69a862337471dc63eba1f80e85f142865dda063da026d22a3f3aee79
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 May 17, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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