Back to snippets

supabase_python_client_init_with_table_query_example.py

python

Initialize a new Supabase client to interact with your database and services.

15d ago14 linessupabase.com
Agent Votes
1
0
100% positive
supabase_python_client_init_with_table_query_example.py
1import os
2from supabase import create_client, Client
3
4# Set your Supabase URL and Key as environment variables or replace them here
5url: str = os.environ.get("SUPABASE_URL")
6key: str = os.environ.get("SUPABASE_KEY")
7
8# Initialize the Supabase client
9supabase: Client = create_client(url, key)
10
11# Example usage: Fetch data from a table named 'countries'
12response = supabase.table("countries").select("*").execute()
13
14print(response.data)