Skip to main content

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

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.

Worklife VC New Sponsor

Metadata

Release files for postgrest 2.33.0

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

Source distribution (sdist)

Source distribution for postgrest 2.33.0
File Size Uploaded
postgrest-2.33.0.tar.gz 15.2 kB Details

Built distribution (wheel)

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

Total release size: 39.0 kB

Release files / postgrest-2.33.0.tar.gz

Download URL postgrest-2.33.0.tar.gz
Size 15.2 kB
Tags Source
SHA-256 checksum
How to use checksums
8813be05d129e8fedc1a9649487ffe524242c33ed380e187edcd16c414915217
BLAKE2b-256 checksum
How to use checksums
8c63bbd2229c0081685aad8eb713b5bbca91c83dd6afebd545fb63282cb6ed9f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.8.2

Release files / postgrest-2.33.0-py3-none-any.whl

Download URL postgrest-2.33.0-py3-none-any.whl
Size 23.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
802bb30028b897f929e8b0b64db20d949b0c1c58e5804bcc7da02faebf2c03ae
BLAKE2b-256 checksum
How to use checksums
bb6541a44b64da5b4d9c8bb1e6bbc6a0a71ff9315236438cc5c63bf504ececf9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.8.2

Release history Release notifications | RSS feed

This release

2.33.0 This release

2 release files

2.30.1

2 release files

2.29.0

2 release files

2.28.3

2 release files

2.28.2

2 release files

2.28.1

2 release files

2.28.0

2 release files

2.27.2

2 release files

2.27.0

2 release files

2.26.0

2 release files

2.25.1

2 release files

2.23.0

2 release files

2.22.4

2 release files

2.22.3

2 release files

2.22.2

2 release files

2.22.1

2 release files

2.20.0

2 release files

2.19.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.19.3

2 release files

0.19.1

2 release files

0.19.0

2 release files

0.18.0

2 release files

0.17.2

2 release files

0.17.0

2 release files

0.16.9

2 release files

0.16.4

2 release files

0.16.3

2 release files

0.16.2

2 release files

0.16.1

2 release files

0.16.0

2 release files

0.15.1

2 release files

0.15.0

2 release files

0.14.0

2 release files

0.13.2

2 release files

0.13.0

2 release files

0.12.1

2 release files

0.11.0

2 release files

0.10.6

2 release files

0.10.5

2 release files

0.10.4

2 release files

0.10.3

2 release files

0.0.1

1 release file

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