Prisma Client Python is an auto-generated and fully type-safe database client, offering a modern ORM experience built on top of the Rust-based Prisma Query Engine. It is known for strong type safety and excellent autocompletion features. The library is currently at version 0.15.0. **Important Note:** As of April 15, 2025, active development on Prisma Client Python has officially ceased due to the maintainer's lack of time and significant architectural changes in Prisma's core (rewriting from Rust to TypeScript). The repository was archived on April 15, 2025, and is now read-only, effectively abandoning the project.
pip install prismaVerified import paths — ran on the pinned version, not inferred.
To use Prisma Client Python, you must first define your database schema in a `schema.prisma` file and then run `prisma db push` (or `prisma generate`) from your terminal. This command generates the Python client code based on your schema. Afterwards, you can import and use the `Prisma` client to interact with your database. The example demonstrates an asynchronous client, connecting, creating a user, and finding a user.
Evaluate migration to a different ORM (e.g., SQLAlchemy, SQLModel) or be prepared to maintain a fork of this project.
Upgrade your Python environment to 3.8 or newer.
Always execute `prisma db push` or `prisma generate` in your terminal after making changes to `schema.prisma`.
Import `ValidationError` from `pydantic.v1` for error handling related to `prisma.validate` if encountering issues with Pydantic v2.
Configure your development environment to use `pyright` as the type checker.