Skip to content

Commit 0e77c95

Browse files
committed
update readme
1 parent b11118e commit 0e77c95

File tree

1 file changed

+50
-28
lines changed

1 file changed

+50
-28
lines changed

Diff for: README.md

+50-28
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@
44

55
Supabase client for Python. This mirrors the design of [supabase-js](https://github.com/supabase/supabase-js/blob/master/README.md)
66

7+
## Status
8+
- [x] Alpha: We are testing Supabase with a closed set of customers
9+
- [x] Public Alpha: Anyone can sign up over at [app.supabase.io](https://app.supabase.io). But go easy on us, there are a few kinks.
10+
- [ ] Public Beta: Stable enough for most non-enterprise use-cases
11+
- [ ] Public: Production-ready
12+
13+
We are currently in Public Alpha. Watch "releases" of this repo to get notified of major updates.
14+
15+
<kbd><img src="https://gitcdn.link/repo/supabase/supabase/master/web/static/watch-repo.gif" alt="Watch this repo"/></kbd>
16+
717
## Installation
818

919
**Recomended:** First activate your virtual environment, with your favourites system. For example, we like `poetry` and `conda`!
@@ -41,12 +51,11 @@ from supabase_py import create_client, Client
4151

4252
url: str = os.environ.get("SUPABASE_URL")
4353
key: str = os.environ.get("SUPABASE_KEY")
44-
45-
password = "password"
4654
supabase: Client = create_client(url, key)
47-
user = supabase.auth.sign_up(email, password)
4855
```
4956

57+
Use the supabase client to interface with your database.
58+
5059
### Running Tests
5160

5261
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:
@@ -78,48 +87,61 @@ This is a sample of how you'd use supabase-py. Functions and tests are WIP
7887
## Authenticate
7988

8089
```python
81-
supabase.auth.sign_up({
82-
"email": '[email protected]',
83-
"password": 'example-password',
84-
})
90+
from supabase_py import create_client, Client
91+
92+
url: str = os.environ.get("SUPABASE_TEST_URL")
93+
key: str = os.environ.get("SUPABASE_TEST_KEY")
94+
supabase: Client = create_client(url, key)
95+
# Create a random user login email and password.
96+
random_email: str = "[email protected]"
97+
random_password: str = "fqj13bnf2hiu23h"
98+
user = supabase.auth.sign_up(email=random_email, password=random_password)
8599
```
86100

87101
## Sign-in
88102

89103
```python
90-
supabase.auth.signIn({
91-
"email": '[email protected]',
92-
"password": 'example-password',
93-
})
104+
from supabase_py import create_client, Client
105+
106+
url: str = os.environ.get("SUPABASE_TEST_URL")
107+
key: str = os.environ.get("SUPABASE_TEST_KEY")
108+
supabase: Client = create_client(url, key)
109+
# Sign in using the user email and password.
110+
random_email: str = "[email protected]"
111+
random_password: str = "fqj13bnf2hiu23h"
112+
user = supabase.auth.sign_in(email=random_email, password=random_password)
94113
```
95114

96-
## Sign-in(Auth provider). This is not supported yet
115+
## Managing Data
97116

117+
#### Insertion of Data
98118
```python
99-
supabase.auth.signIn({
100-
// provider can be 'github', 'google', 'gitlab', or 'bitbucket'
101-
"provider": 'github'
102-
})
103-
```
119+
from supabase_py import create_client, Client
104120

105-
## Managing Data
121+
url: str = os.environ.get("SUPABASE_TEST_URL")
122+
key: str = os.environ.get("SUPABASE_TEST_KEY")
123+
supabase: Client = create_client(url, key)
124+
data = supabase.table("countries").select("*").execute()
125+
assert len(data.get("data", [])) > 0
126+
```
106127

128+
#### Selection of Data
107129
```python
108-
supabase
109-
.from('countries')
110-
.select("
111-
name,
112-
cities (
113-
name
114-
)
115-
")
130+
from supabase_py import create_client, Client
131+
132+
url: str = os.environ.get("SUPABASE_TEST_URL")
133+
key: str = os.environ.get("SUPABASE_TEST_KEY")
134+
supabase: Client = create_client(url, key)
135+
data = supabase.table("countries").select("*").execute()
136+
# Assert we pulled real data.
137+
assert len(data.get("data", [])) > 0
116138
```
117139

118140
## Realtime Changes
119141

120142
```python
121-
mySubscription = supabase
122-
.from('countries')
143+
subscription = supabase
144+
.table('countries')
123145
.on('*', lambda x: print(x))
124146
.subscribe()
125147
```

0 commit comments

Comments
 (0)