A Python project to connect to Supabase and insert user data (name_surname and favourite_color).
- Python 3.11+
- Supabase URL and anon/service key
-
Clone or open this project
-
Setup Virtual Environment / Install dependencies:
pip install supabase python-dotenv
-
Configure environment variables:
- Add your Supabase credentials to
.env:SUPABASE_URL=https://your-project.supabase.co SUPABASE_KEY=your-anon-key-here
- Add your Supabase credentials to
main.py- Main script to insert data into Supabase.env- Environment variables (not tracked in git).gitignore- Git ignore fileREADME.md- This file
=== Supabase Database Demo ===
Inserting: John_Doe with favorite color: Blue
✅ Data inserted successfully!
Inserted: {'name_surname': 'John_Doe', 'favourite_color': 'Blue'}
Response: [{'id': 1, 'name_surname': 'John_Doe', 'favourite_color': 'Blue', 'created_at': '2025-10-16T...'}]
- Missing credentials: Ensure your
.envfile exists and contains valid Supabase credentials - Table not found: Make sure you've created the table in Supabase and updated the table name in
main.py - Connection error: Verify your Supabase URL and key are correct