postgrest-py
PostgREST client for Python. This library provides an "ORM-like" interface to PostgREST.
INSTALLATION
Requirements
- Python >= 3.11
- PostgreSQL >= 13
- PostgREST >= 11
Local PostgREST server
If you want to use a local PostgREST server for development, you can use our preconfigured instance via Docker Compose.
docker-compose up
Once Docker Compose started, PostgREST is accessible at http://localhost:3000.
Instructions
With uv (recommended)
uv add postgrest
With Pip
pip install postgrest
Supabase Service Compatibility
postgrest only guarantees compatibility with the latest PostgREST release. Older PostgREST releases are supported on a best-effort basis, but compatibility is not guaranteed.
If you self-host PostgREST, we recommend upgrading to the latest release when upgrading this SDK.
USAGE
Getting started
import asyncio
from postgrest import AsyncPostgrestClient
async def main():
async with AsyncPostgrestClient("http://localhost:3000") as client:
r = await client.from_("countries").select("*").execute()
countries = r.data
asyncio.run(main())
Create
await client.from_("countries").insert({ "name": "Việt Nam", "capital": "Hà Nội" }).execute()
Read
r = await client.from_("countries").select("id", "name").execute()
countries = r.data
Update
await client.from_("countries").update({"capital": "Hà Nội"}).eq("name", "Việt Nam").execute()
Delete
await client.from_("countries").delete().eq("name", "Việt Nam").execute()
General filters
Stored procedures (RPC)
await client.rpc("foobar", {"arg1": "value1", "arg2": "value2"}).execute()
CHANGELOG
Read more here.
SPONSORS
We are building the features of Firebase using enterprise-grade, open source products. We support existing communities wherever possible, and if the products don’t exist we build them and open source them ourselves. Thanks to these sponsors who are making the OSS ecosystem better for everyone.
Metadata
Release files for postgrest 2.34.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| postgrest-2.34.0.tar.gz | 16.7 kB | Without provenance | Details for postgrest-2.34.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| postgrest-2.34.0-py3-none-any.whl | Python 3 | none | any | Details for postgrest-2.34.0-py3-none-any.whl |
Total release size: 42.4 kB
Release files / postgrest-2.34.0.tar.gz
| Download URL | postgrest-2.34.0.tar.gz |
|---|---|
| Size | 16.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e3550bdb1c1c81d4ad3bf2d828be524c98def20d877ee65c9b0e48331c0c5eaa
|
|
BLAKE2b-256 checksum How to use checksums |
eb25ec5e45702226f41b68c871fa1e85a59f61cb23ecfd2eb27249a2be70cf6e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.3 {"installer":{"name":"uv","version":"0.13.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / postgrest-2.34.0-py3-none-any.whl
| Download URL | postgrest-2.34.0-py3-none-any.whl |
|---|---|
| Size | 25.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
091ef21ff1de1b8737f18734ad66e5d0c45c330fb4053c0bde5fe4b35a9cd389
|
|
BLAKE2b-256 checksum How to use checksums |
21400d89ed2d7983a7ee6bb22b305cd72580b5c5144b9b4c2f6bd84cf93ff1e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.3 {"installer":{"name":"uv","version":"0.13.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for postgrest 2.34.0
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.