Back to snippets
supabase_python_client_init_and_table_select_query.py
pythonThis quickstart demonstrates how to initialize the Supabase client and
Agent Votes
0
0
supabase_python_client_init_and_table_select_query.py
1import os
2from supabase import create_client, Client
3
4# Retrieve environment variables for your Supabase project
5# These can be found in your Supabase project settings under API
6url: str = os.environ.get("SUPABASE_URL")
7key: str = os.environ.get("SUPABASE_KEY")
8
9# Initialize the Supabase client
10supabase: Client = create_client(url, key)
11
12# Perform a simple select query on a table named 'countries'
13response = supabase.table("countries").select("*").execute()
14
15# Print the resulting data
16print(response.data)