Python Client Library for Supabase Auth
Actively maintained. Last release 3 weeks ago, commits in 21 of the last 26 weeks. A safe choice.
pip install supabase-authAuth-py
This is a Python port of the supabase js gotrue client. The current state is that there is a features parity but with small differences that are mentioned in the section Differences to the JS client. As of December 14th, we renamed to repo from gotrue-py to auth-py to mirror the changes in the JavaScript library.
Installation
The package can be installed using pip, uv or poetry:
Pip
pip install supabase_auth
Uv
uv add supabase_auth
Poetry
poetry add supabase_auth
Features
- Full feature parity with the JavaScript client
- Support for both synchronous and asynchronous operations
- MFA (Multi-Factor Authentication) support
- OAuth and SSO integration
- Magic link and OTP authentication
- Phone number authentication
- Anonymous sign-in
- Session management with auto-refresh
- JWT token handling and verification
- User management and profile updates
Differences to the JS client
It should be noted there are differences to the JS client. 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.
Firstly, feature pairity is not 100% with the JS client. In most cases we match the methods and attributes of the JS client 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.
There is also a divergence in terms of how errors are raised. In the , 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.