postgrest-py
PostgREST client for Python. This library provides an "ORM-like" interface to PostgREST.
INSTALLATION
Requirements
- Python >= 3.9
- 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
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.32.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 | |
|---|---|---|---|
| postgrest-2.32.0.tar.gz | 15.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| postgrest-2.32.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 38.8 kB
Release files / postgrest-2.32.0.tar.gz
| Download URL | postgrest-2.32.0.tar.gz |
|---|---|
| Size | 15.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
20c6966d0e33d5037386fbe5bd41edd05d72748e014fbdc9d4c55308690dbe7a
|
|
BLAKE2b-256 checksum How to use checksums |
d7459010c2b79d53d0674b9dbc5e4eaa7a0a3b31f98d63707e346d3e02210380
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.8.2
|
Release files / postgrest-2.32.0-py3-none-any.whl
| Download URL | postgrest-2.32.0-py3-none-any.whl |
|---|---|
| Size | 23.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2386155853917089510ee4e322a0f44909e9495a12ec4b3e1294ab79551a500e
|
|
BLAKE2b-256 checksum How to use checksums |
cd07219db7654f4877d590fa4a8b33012bca3ef44d0130a701d9133824a7b108
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.8.2
|