{"id":5728,"library":"supafunc","title":"Supabase Functions Python Client (Deprecated)","description":"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.","status":"deprecated","version":"0.10.2","language":"en","source_language":"en","source_url":"https://github.com/supabase/functions-py","tags":["supabase","serverless","functions","edge functions","api client","deprecated"],"install":[{"cmd":"pip install supafunc","lang":"bash","label":"Deprecated (use supabase_functions instead)"},{"cmd":"pip install supabase_functions","lang":"bash","label":"Recommended replacement"}],"dependencies":[{"reason":"Used for underlying HTTP requests, especially when injecting custom clients.","package":"httpx","optional":true}],"imports":[{"note":"The `supafunc` package is deprecated. Use `supabase_functions` for new projects and migrate existing ones.","wrong":"from supafunc import AsyncFunctionsClient","symbol":"AsyncFunctionsClient","correct":"from supabase_functions import AsyncFunctionsClient"},{"note":"The `supafunc` package is deprecated. Use `supabase_functions` for new projects and migrate existing ones.","wrong":"from supafunc import FunctionsClient","symbol":"FunctionsClient","correct":"from supabase_functions import FunctionsClient"}],"quickstart":{"code":"import os\nfrom supabase import create_client\n\n# Note: This quickstart uses the recommended 'supabase_functions' client\n# Ensure your Supabase project URL and Anon Key are set as environment variables\nSUPABASE_URL = os.environ.get('SUPABASE_URL', 'YOUR_SUPABASE_URL')\nSUPABASE_ANON_KEY = os.environ.get('SUPABASE_ANON_KEY', 'YOUR_SUPABASE_ANON_KEY')\n\n# Initialize the Supabase client, which includes the functions client\nsupabase = create_client(SUPABASE_URL, SUPABASE_ANON_KEY)\nfunctions_client = supabase.functions\n\nasync def invoke_hello_world():\n    try:\n        # Assuming you have an Edge Function named 'hello-world' deployed\n        # that expects a JSON body like {'name': 'World'}\n        response = await functions_client.invoke(\n            'hello-world',\n            invoke_options={'body': {'name': 'Supabase User'}}\n        )\n        print(f\"Function invoked successfully: {response.data}\")\n    except Exception as e:\n        print(f\"Error invoking function: {e}\")\n\nif __name__ == '__main__':\n    import asyncio\n    asyncio.run(invoke_hello_world())","lang":"python","description":"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."},"warnings":[{"fix":"Migrate all package references (e.g., in `pyproject.toml`, `requirements.txt`) from `supafunc` to `supabase_functions` and update all import statements (e.g., `from supafunc import ...` to `from supabase_functions import ...`).","message":"The `supafunc` package is officially deprecated as of August 8, 2025, in favor of `supabase_functions`. Version `0.10.2` is the last to receive updates and will issue deprecation warnings upon import. Future development and bug fixes will only be applied to `supabase_functions`.","severity":"breaking","affected_versions":">=0.10.2 (for deprecation warnings), all versions (for future support)"},{"fix":"Upgrade your Python environment to version 3.9 or higher.","message":"The minimum required Python version was bumped to 3.9 in `v0.6.2`. Users on older Python versions will encounter compatibility issues.","severity":"breaking","affected_versions":"<0.6.2"},{"fix":"Update your code to use the new `Region` Enum members (e.g., `Region.US_EAST_1`) instead of string literals, if applicable.","message":"In `v0.9.0`, region enumerated literals were rewritten as Python Enums. If your code relied on specific string values or direct comparisons with previous literal representations, this could be a breaking change.","severity":"breaking","affected_versions":">=0.9.0"},{"fix":"Upgrade to `v0.10.1` or `supabase_functions` to ensure compatibility with all API key types. If using an older version, ensure your API key is compatible with the stricter validation.","message":"Prior to `v0.10.1`, strict JWT key validation might have caused issues with newer Supabase API keys. This was resolved by relaxing the validation.","severity":"gotcha","affected_versions":"<0.10.1"},{"fix":"Upgrade to `v0.9.3` or `supabase_functions` if you are sending non-JSON payloads to your Edge Functions.","message":"Versions prior to `v0.9.3` improperly handled non-JSON body types when invoking functions, potentially leading to incorrect data transmission or errors.","severity":"gotcha","affected_versions":"<0.9.3"}],"env_vars":null,"last_verified":"2026-04-10T00:00:00.000Z","next_check":"2026-07-09T00:00:00.000Z"}