Skip to main content

postgrest-py

License: MIT CI Python Version Codecov Last commit GitHub commit activity Github Stars Github Forks Github Watchers GitHub contributors

PostgREST client for Python. This library provides an ORM interface to PostgREST.

Status: Unstable

INSTALLATION

Requirements

  • Python >= 3.7
  • PostgreSQL >= 12
  • PostgREST >= 7

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 Poetry (recommended)

poetry 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()

DEVELOPMENT

git clone https://github.com/supabase/postgrest-py.git
cd postgrest-py
poetry install
poetry run pre-commit install

Testing

poetry run pytest

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-py 0.10.6

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-py 0.10.6
File Size Uploaded
postgrest_py-0.10.6.tar.gz 13.8 kB Details

Built distribution (wheel)

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

Total release size: 31.9 kB

Release files / postgrest_py-0.10.6.tar.gz

Download URL postgrest_py-0.10.6.tar.gz
Size 13.8 kB
Tags Source
SHA-256 checksum
How to use checksums
106adc046546165798e4a380585f66bbf1bbcdcbbe094abbea7aaabfef37f2d1
BLAKE2b-256 checksum
How to use checksums
6755dbed1b827241e1ab87811568d9c8099f7b421743b828297945c2cfc2ca91
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.11.2 Darwin/22.2.0

Release files / postgrest_py-0.10.6-py3-none-any.whl

Download URL postgrest_py-0.10.6-py3-none-any.whl
Size 18.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
434acf3a3eeb196a575e6a4db65072222ca6d60d665cf9a1f4c4a84489b47a44
BLAKE2b-256 checksum
How to use checksums
4bc0c1604bb9c0171acc1019b6d1da5e919a7bddd07fe6099b8d8db898134975
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.11.2 Darwin/22.2.0

Release history Release notifications | RSS feed

This release

0.10.6 This release

2 release files

0.10.4

2 release files

0.10.3

2 release files

0.10.2

2 release files

0.10.0

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.2.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