Skip to content

Commit 8992382

Browse files
committed
chore: fix warnings of markdown files
1 parent 01aea7f commit 8992382

File tree

3 files changed

+25
-11
lines changed

3 files changed

+25
-11
lines changed

CODE_OF_CONDUCT.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# Contributor Covenant Code of Conduct
32

43
## Our Pledge
@@ -69,9 +68,9 @@ members of the project's leadership.
6968
## Attribution
7069

7170
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
72-
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
71+
available at <https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>
7372

7473
[homepage]: https://www.contributor-covenant.org
7574

7675
For answers to common questions about this code of conduct, see
77-
https://www.contributor-covenant.org/faq
76+
<https://www.contributor-covenant.org/faq>

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ In the interest of fostering an open and welcoming environment, please review an
1010

1111
All submissions, including submissions by project members, require review. We
1212
use GitHub pull requests for this purpose. Consult
13-
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
13+
[GitHub Help](https://help.github.com/articles/about-pull-requests) for more
1414
information on using pull requests.
1515

1616
## Report an issue
@@ -27,6 +27,6 @@ When making pull requests to the repository, make sure to follow these guideline
2727

2828
- Before creating a pull request, file a GitHub Issue so that maintainers and the community can discuss the problem and potential solutions before you spend time on an implementation.
2929
- In your PR's description, link to any related issues or pull requests to give reviewers the full context of your change.
30-
- For commit messages, follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) format.
30+
- For commit messages, follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0) format.
3131
- For example, if you update documentation for a specific extension, your commit message might be: `docs(extension-name) updated installation documentation`.
3232
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md

README.md

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,43 @@
11
# Gotrue-py
2-
This is a Python port of the [supabase js gotrue client](https://github.com/supabase/gotrue-js/). The current status is that there is not complete feature pairity when compared with the js-client, but this something we are working on.
2+
3+
This is a Python port of the [supabase js gotrue client](https://github.com/supabase/gotrue-js). The current status is that there is not complete feature pairity when compared with the js-client, but this something we are working on.
34

45
## Installation
6+
57
We are still working on making the go-true python library more user-friendly. For now here are some sparse notes on how to install the module
68

79
### Poetry
10+
811
```bash
912
poetry add gotrue
1013
```
1114

1215
### Pip
16+
1317
```bash
1418
pip install gotrue
1519
```
1620

1721
## Differences to the JS client
18-
It should be noted there are differences to the [JS client](https://github.com/supabase/gotrue-js/). If you feel particulaly strongly about them and want to motivate a change, feel free to make a GitHub issue and we can discuss it there.
1922

20-
Firstly, feature pairity is not 100% with the [JS client](https://github.com/supabase/gotrue-js/). In most cases we match the methods and attributes of the [JS client](https://github.com/supabase/gotrue-js/) and api classes, but is some places (e.g for browser specific code) it didn't make sense to port the code line for line.
23+
It should be noted there are differences to the [JS client](https://github.com/supabase/gotrue-js). If you feel particulaly strongly about them and want to motivate a change, feel free to make a GitHub issue and we can discuss it there.
24+
25+
Firstly, feature pairity is not 100% with the [JS client](https://github.com/supabase/gotrue-js). In most cases we match the methods and attributes of the [JS client](https://github.com/supabase/gotrue-js) and api classes, but is some places (e.g for browser specific code) it didn't make sense to port the code line for line.
2126

22-
There is also a divergence in terms of how errors are raised. In the [JS client](https://github.com/supabase/gotrue-js/), the errors are returned as part of the object, which the user can choose to process in whatever way they see fit. In this Python client, we raise the errors directly where they originate, as it was felt this was more Pythonic and adhered to the idioms of the language more directly.
27+
There is also a divergence in terms of how errors are raised. In the [JS client](https://github.com/supabase/gotrue-js), the errors are returned as part of the object, which the user can choose to process in whatever way they see fit. In this Python client, we raise the errors directly where they originate, as it was felt this was more Pythonic and adhered to the idioms of the language more directly.
2328

2429
In JS we return the error, but in Python we just raise it.
30+
2531
```js
2632
const { data, error } = client.sign_up(...)
2733
```
2834

29-
The other key difference is we do not use pascalCase to encode variable and method names. Instead we use the snake_case convention adopted in the Python language.
35+
The other key difference is we do not use pascalCase to encode variable and method names. Instead we use the snake_case convention adopted in the Python language.
3036

3137
## Usage
38+
3239
To instanciate the client, you'll need the URL and any request headers at a minimum.
40+
3341
```python
3442
from gotrue import Client
3543

@@ -41,23 +49,27 @@ client: Client = Client(url="www.genericauthwebsite.com", headers=headers)
4149
```
4250

4351
To send a magic email link to the user, just provide the email kwarg to the `sign_in` method:
52+
4453
```python
4554
user: Dict[str, Any] = client.sign_up(email="[email protected]")
4655
```
4756

4857
To login with email and password, provide both to the `sign_in` method:
58+
4959
```python
5060
user: Dict[str, Any] = client.sign_up(email="[email protected]", password="*********")
5161
```
5262

5363
To sign out of the logged in user, call the `sign_out` method. We can then assert that the session and user are null values.
64+
5465
```python
5566
client.sign_out()
5667
assert client.user() is None
5768
assert client.session() is None
5869
```
5970

6071
We can refesh a users session.
72+
6173
```python
6274
# The user should already be signed in at this stage.
6375
user = client.refresh_session()
@@ -66,19 +78,22 @@ assert client.session() is not None
6678
```
6779

6880
## Tests
81+
6982
At the moment we use a pre-defined supabase instance to test the functionality. This may change over time. You can run the tests like so:
83+
7084
```bash
7185
SUPABASE_TEST_KEY="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlhdCI6MTYxMjYwOTMyMiwiZXhwIjoxOTI4MTg1MzIyfQ.XL9W5I_VRQ4iyQHVQmjG0BkwRfx6eVyYB3uAKcesukg" \
7286
SUPABASE_TEST_URL="https://tfsatoopsijgjhrqplra.supabase.co" \
7387
pytest -sx
7488
```
7589

7690
## Contributions
91+
7792
We would be immensely grateful for any contributions to this project. In particular are the following items:
93+
7894
- [x] Figure out to use either Sessions to manage headers or allow passing in of headers
7995
- [ ] Add documentation.
8096
- [ ] Add more tests.
8197
- [ ] Ensuring feature-parity with the js-client.
8298
- [ ] Supporting 3rd party provider authentication.
8399
- [ ] Implement a js port of setTimeout for the refresh session code.
84-

0 commit comments

Comments
 (0)