postgrest-py
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.
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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| postgrest_py-0.10.6.tar.gz | 13.8 kB | Without provenance | Details for postgrest_py-0.10.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| postgrest_py-0.10.6-py3-none-any.whl | Python 3 | none | any | Details for postgrest_py-0.10.6-py3-none-any.whl |
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
|
Security for postgrest-py 0.10.6
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.