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2.18.0
2.17.0
2.16.0
2.15.3
2.15.2
2.15.1
2.15.0
2.14.0
2.13.0
2.12.0
2.11.0
2.10.0
2.1.1
2.1.0
2.0.3
2.0.2
2.0.1
2.0.0
1.2.0
1.1.1
1.1.0
1.0.6
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0
0.7.1
0.6.0
0.5.8
0.5.7
0.5.6
0.5.5
0.5.4
0.5.3
0.5.2
0.5.1
0.5.0
0.4.0
0.3.2
0.3.1
0.3.0
0.2.0
0.1.1
0.0.3
توضیحات
Supabase client for Python.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | supabase-3.0.0a1 |
| نام | supabase |
| نسخه کتابخانه | 3.0.0a1 |
| نگهدارنده | ['Leonardo Santiago'] |
| ایمیل نگهدارنده | ['Leonardo Santiago <leonardo.santiago@supabase.io>'] |
| نویسنده | Joel Lee, Leon Fedden, Daniel Reinón García, Leynier Gutiérrez González, Anand, Andrew Smith |
| ایمیل نویسنده | Joel Lee <joel@joellee.org>, Leon Fedden <leonfedden@gmail.com>, Daniel Reinón García <danielreinon@outlook.com>, Leynier Gutiérrez González <leynier41@gmail.com>, Andrew Smith <a.smith@silentworks.co.uk> |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/supabase/ |
| مجوز | - |
# `supabase-py`
Python client for [Supabase](https://supabase.com)
- Documentation: [supabase.com/docs](https://supabase.com/docs/reference/python/introduction)
- Usage:
- [GitHub OAuth in your Python Flask app](https://supabase.com/blog/oauth2-login-python-flask-apps)
- [Python data loading with Supabase](https://supabase.com/blog/loading-data-supabase-python)
### PyPI installation
Install the package (for Python >= 3.9):
```bash
# with pip
pip install supabase
# with uv
uv add supabase
# with conda
conda install -c conda-forge supabase
```
## Usage
Set your Supabase environment variables in a dotenv file, or using the shell:
```bash
export SUPABASE_URL="my-url-to-my-awesome-supabase-instance"
export SUPABASE_KEY="my-supa-dupa-secret-supabase-api-key"
```
Init client:
```python
import os
from supabase import create_client, Client
url: str = os.environ.get("SUPABASE_URL")
key: str = os.environ.get("SUPABASE_KEY")
supabase: Client = create_client(url, key)
```
Use the supabase client to interface with your database.
### Sign-up
```python
user = supabase.auth.sign_up({ "email": users_email, "password": users_password })
```
### Sign-in
```python
user = supabase.auth.sign_in_with_password({ "email": users_email, "password": users_password })
```
### Insert Data
```python
data = supabase.table("countries").insert({"name":"Germany"}).execute()
# Assert we pulled real data.
assert len(data.data) > 0
```
### Select Data
```python
data = supabase.table("countries").select("*").eq("country", "IL").execute()
# Assert we pulled real data.
assert len(data.data) > 0
```
### Update Data
```python
data = supabase.table("countries").update({"country": "Indonesia", "capital_city": "Jakarta"}).eq("id", 1).execute()
```
### Update data with duplicate keys
```python
country = {
"country": "United Kingdom",
"capital_city": "London" # This was missing when it was added
}
data = supabase.table("countries").upsert(country).execute()
assert len(data.data) > 0
```
### Delete Data
```python
data = supabase.table("countries").delete().eq("id", 1).execute()
```
### Call Edge Functions
```python
def test_func():
try:
resp = supabase.functions.invoke("hello-world", invoke_options={'body':{}})
return resp
except (FunctionsRelayError, FunctionsHttpError) as exception:
err = exception.to_dict()
print(err.get("message"))
```
### Download a file from Storage
```python
bucket_name: str = "photos"
data = supabase.storage.from_(bucket_name).download("photo1.png")
```
### Upload a file
```python
bucket_name: str = "photos"
new_file = getUserFile()
data = supabase.storage.from_(bucket_name).upload("/user1/profile.png", new_file)
```
### Remove a file
```python
bucket_name: str = "photos"
data = supabase.storage.from_(bucket_name).remove(["old_photo.png", "image5.jpg"])
```
### List all files
```python
bucket_name: str = "charts"
data = supabase.storage.from_(bucket_name).list()
```
### Move and rename files
```python
bucket_name: str = "charts"
old_file_path: str = "generic/graph1.png"
new_file_path: str = "important/revenue.png"
data = supabase.storage.from_(bucket_name).move(old_file_path, new_file_path)
```
## Important: Proper Client Shutdown
To ensure the Supabase client terminates correctly and to prevent resource leaks, you **must** explicitly call:
```python
client.auth.sign_out()
```
نیازمندی
| مقدار | نام |
|---|---|
| - | realtime==2.30.0 |
| - | supabase-functions==2.30.0 |
| - | storage3==2.30.0 |
| - | supabase-auth==2.30.0 |
| - | postgrest==2.30.0 |
| - | httpx<0.29,>=0.26 |
| - | yarl>=1.22.0 |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.9 | Python |
نحوه نصب
نصب پکیج whl supabase-3.0.0a1:
pip install supabase-3.0.0a1.whl
نصب پکیج tar.gz supabase-3.0.0a1:
pip install supabase-3.0.0a1.tar.gz