Metadata-Version: 2.1
Name: supabase-py-async
Version: 2.0.4
Summary: supabase-py with async synax
Home-page: https://github.com/Atticuszz/supabase-py_async
License: MIT
Author: Atticuszz
Author-email: 1831768457@qq.com
Requires-Python: >=3.9,<3.13
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: aiohttp (>=3.8.6,<4.0.0)
Requires-Dist: deprecation (>=2.1.0,<3.0.0)
Requires-Dist: gotrue (>=1.2.0,<2.0.0)
Requires-Dist: postgrest (>=0.13.0,<0.14.0)
Requires-Dist: realtime (>=1.0.0,<2.0.0)
Requires-Dist: storage3 (>=0.6.1,<0.7.0)
Requires-Dist: supafunc (==0.3.1)
Project-URL: Repository, https://github.com/Atticuszz/supabase-py_async
Description-Content-Type: text/markdown

# supabase-py-async

[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg?label=license)](https://opensource.org/licenses/MIT)
[![CI](https://github.com/Atticuszz/supabase-py-async/actions/workflows/ci.yml/badge.svg)](https://github.com/Atticuszz/supabase-py-async/actions/workflows/ci.yml)
[![Python](https://img.shields.io/pypi/pyversions/supabase-py-async)](https://pypi.org/project/supabase-py-async)
[![Version](https://img.shields.io/pypi/v/supabase-py-async?color=%2334D058)](https://pypi.org/project/supabase-py-async)

<!-- Add more badges as needed -->
[![Downloads](https://pepy.tech/badge/supabase-py-async)](https://pepy.tech/project/supabase-py-async)
[![Open Issues](https://img.shields.io/github/issues/Atticuszz/supabase-py-async)](https://github.com/Atticuszz/supabase-py-async/issues)
[![Pull Requests](https://img.shields.io/github/issues-pr/Atticuszz/supabase-py-async)](https://github.com/Atticuszz/supabase-py-async/pulls)
[![Contributors](https://img.shields.io/github/contributors/Atticuszz/supabase-py-async)](https://github.com/Atticuszz/supabase-py-async/graphs/contributors)
[![Code Size](https://img.shields.io/github/languages/code-size/Atticuszz/supabase-py-async)](https://github.com/Atticuszz/supabase-py-async)

Supabase client for Python with Async support. This project is an asynchronous variant
of [supabase-py](https://github.com/supabase-community/supabase-py) and mirrors the design
of [supabase-js](https://github.com/supabase/supabase-js/blob/master/README.md).

## Status

| Status | Stability    | Goal                                                                                                              |
|--------|--------------|-------------------------------------------------------------------------------------------------------------------|
| 🚧     | Alpha        | We are testing Supabase with a closed set of customers                                                            |
| 🚧     | Public Alpha | Anyone can sign up over at [app.supabase.io](https://app.supabase.com). But go easy on us, there are a few kinks. |
| ❌      | Public Beta  | Stable enough for most non-enterprise use-cases                                                                   |
| ❌      | Public       | Production-ready                                                                                                  |

## Installation

### PyPi Installation

To install the package for Python 3.7 and above:

```bash
# with pip
pip install supabase-py-async

# with poetry
poetry add supabase-py-async
```

### Local Installation

For local development, clone this repo and install in Development mode with `pip install -e`.

## Async Usage

It's usually best practice to set your api key environment variables in some way that version control doesn't track
them, e.g don't put them in your python modules! Set the key and url for the supabase instance in the shell, or better
yet, use a dotenv file. Heres how to set the variables in the shell.

```bash
export SUPABASE_URL="my-url-to-my-awesome-supabase-instance"
export SUPABASE_KEY="my-supa-dupa-secret-supabase-api-key"
```

This client is designed to be used asynchronously. Below are some examples on how to use it.

### Initialize Supabase Client

```python
import os
from supabase_py_async import create_client, AsyncClient

url: str = os.environ.get("SUPABASE_URL")

key: str = os.environ.get("SUPABASE_KEY")

supabase: AsyncClient = create_client(url, key)
```

### Async Data Operations

```python
async def data_operations():
  # Insert
  insert_data = await supabase.table("countries").insert({"name": "Germany"}).execute()

  # Select
  select_data = await supabase.table("countries").select("*").eq("country", "IL").execute()

  # Update
  update_data = await supabase.table("countries").update({"country": "Indonesia", "capital_city": "Jakarta"}).eq("id",
                                                                                                                 1).execute()

  # Delete
  delete_data = await supabase.table("countries").delete().eq("id", 1).execute()


asyncio.run(data_operations())
```

### Async Authentication

```python
async def async_auth():
  random_email: str = "email@example.com"
  random_password: str = "supersecurepassword"
  user = await supabase.auth.sign_up(email=random_email, password=random_password)


asyncio.run(async_auth())
```

<!-- Include more examples and documentation links -->

See [Supabase Docs](https://supabase.com/docs/guides/client-libraries) for a full list of examples.

## Contributions

Feel free to contribute to this project. We are in the early stages and appreciate any help.

## Note

the README.md file is generated by GPT4 from the supabase-py's README.md 

