Skip to content

Commit b11118e

Browse files
Joel LeeJoel Lee
authored andcommitted
Minor Updates to README
1 parent fd842a1 commit b11118e

File tree

1 file changed

+29
-15
lines changed

1 file changed

+29
-15
lines changed

README.md

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,32 @@ Supabase client for Python. This mirrors the design of [supabase-js](https://git
99
**Recomended:** First activate your virtual environment, with your favourites system. For example, we like `poetry` and `conda`!
1010

1111
#### PyPi installation
12+
1213
Now install the package.
14+
1315
```bash
1416
pip install supabase
1517
```
1618

1719
#### Local installation
20+
1821
You can also installing from after cloning this repo. Install like below to install in Development Mode, which means when you edit the source code the changes will be reflected in your python module.
19-
```bash
22+
23+
```bash
2024
pip install -e .
2125
```
2226

2327
## Usage
28+
2429
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.
30+
2531
```bash
2632
export SUPABASE_URL="my-url-to-my-awesome-supabase-instance"
2733
export SUPABASE_KEY="my-supa-dupa-secret-supabase-api-key"
2834
```
2935

3036
We can then read the keys in the python source code.
37+
3138
```python
3239
import os
3340
from supabase_py import create_client, Client
@@ -41,58 +48,63 @@ user = supabase.auth.sign_up(email, password)
4148
```
4249

4350
### Running Tests
51+
4452
Currently the test suites are in a state of flux. We are expanding our clients tests to ensure things are working, and for now can connect to this test instance, that is populated with the following table:
53+
4554
<p align="center">
4655
<img width="720" height="481" src="https://i.ibb.co/Bq7Kdty/db.png">
4756
</p>
4857

49-
The above test database is a blank supabase instance that has populated the `countries` table with the built in countries script that can be found in the supabase UI. You can launch the test scripts and point to the above test database with the
58+
The above test database is a blank supabase instance that has populated the `countries` table with the built in countries script that can be found in the supabase UI. You can launch the test scripts and point to the above test database with the
59+
5060
```bash
5161
SUPABASE_TEST_KEY="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlhdCI6MTYxMjYwOTMyMiwiZXhwIjoxOTI4MTg1MzIyfQ.XL9W5I_VRQ4iyQHVQmjG0BkwRfx6eVyYB3uAKcesukg" \
5262
SUPABASE_TEST_URL="https://tfsatoopsijgjhrqplra.supabase.co" \
5363
pytest -x
5464
```
5565

5666
### See issues for what to work on
67+
5768
Rough roadmap:
69+
5870
- [ ] Wrap [Postgrest-py](https://github.com/supabase/postgrest-py/)
5971
- [ ] Wrap [Realtime-py](https://github.com/supabase/realtime-py)
6072
- [x] Wrap [Gotrue-py](https://github.com/J0/gotrue-py)
6173

74+
### Client Library
6275

76+
This is a sample of how you'd use supabase-py. Functions and tests are WIP
6377

64-
### Client Library
65-
This is a sample of how you'd use [supabase-py]. Functions and tests are WIP
78+
## Authenticate
6679

67-
## Authenticate
68-
```
69-
supabase.auth.signUp({
80+
```python
81+
supabase.auth.sign_up({
7082
"email": '[email protected]',
7183
"password": 'example-password',
7284
})
7385
```
7486

75-
7687
## Sign-in
77-
```
88+
89+
```python
7890
supabase.auth.signIn({
7991
"email": '[email protected]',
8092
"password": 'example-password',
8193
})
8294
```
8395

84-
8596
## Sign-in(Auth provider). This is not supported yet
86-
```
97+
98+
```python
8799
supabase.auth.signIn({
88100
// provider can be 'github', 'google', 'gitlab', or 'bitbucket'
89101
"provider": 'github'
90102
})
91103
```
92104

93-
94105
## Managing Data
95-
```
106+
107+
```python
96108
supabase
97109
.from('countries')
98110
.select("
@@ -104,10 +116,12 @@ supabase
104116
```
105117

106118
## Realtime Changes
107-
```
119+
120+
```python
108121
mySubscription = supabase
109122
.from('countries')
110123
.on('*', lambda x: print(x))
111124
.subscribe()
112-
```
125+
```
126+
113127
See [Supabase Docs](https://supabase.io/docs/guides/client-libraries) for full list of examples

0 commit comments

Comments
 (0)