Supabase Functions Python Client (Deprecated)

0.10.2 · deprecated · verified Fri Apr 10

supafunc is a Python client library for interacting with Supabase Edge Functions. It provides synchronous and asynchronous APIs to invoke serverless functions deployed on Supabase. As of August 8, 2025, this package is officially deprecated in favor of `supabase_functions` to align with the JavaScript client library naming convention. Version 0.10.2 is the last version that received updates under this name and includes deprecation warnings upon import.

Warnings

Install

Imports

Quickstart

This example demonstrates how to invoke a Supabase Edge Function using the recommended `supabase-py` client, which includes the `supabase_functions` client for invoking functions. It assumes an Edge Function named 'hello-world' is deployed on your Supabase project. Replace placeholder environment variables with your actual Supabase project URL and Anon Key.

import os
from supabase import create_client

# Note: This quickstart uses the recommended 'supabase_functions' client
# Ensure your Supabase project URL and Anon Key are set as environment variables
SUPABASE_URL = os.environ.get('SUPABASE_URL', 'YOUR_SUPABASE_URL')
SUPABASE_ANON_KEY = os.environ.get('SUPABASE_ANON_KEY', 'YOUR_SUPABASE_ANON_KEY')

# Initialize the Supabase client, which includes the functions client
supabase = create_client(SUPABASE_URL, SUPABASE_ANON_KEY)
functions_client = supabase.functions

async def invoke_hello_world():
    try:
        # Assuming you have an Edge Function named 'hello-world' deployed
        # that expects a JSON body like {'name': 'World'}
        response = await functions_client.invoke(
            'hello-world',
            invoke_options={'body': {'name': 'Supabase User'}}
        )
        print(f"Function invoked successfully: {response.data}")
    except Exception as e:
        print(f"Error invoking function: {e}")

if __name__ == '__main__':
    import asyncio
    asyncio.run(invoke_hello_world())

view raw JSON →