diff --git a/README.md b/README.md index b774e26d..ec867633 100644 --- a/README.md +++ b/README.md @@ -85,13 +85,13 @@ The above test database is a blank supabase instance that has populated the `cou Rough roadmap: -- [ ] Wrap [Postgrest-py](https://github.com/supabase/postgrest-py/) +- [x] Wrap [Postgrest-py](https://github.com/supabase/postgrest-py/) - [ ] Wrap [Realtime-py](https://github.com/supabase/realtime-py) - [x] Wrap [Gotrue-py](https://github.com/J0/gotrue-py) ### Client Library -This is a sample of how you'd use supabase-py. Functions and tests are WIP +This is a sample of how you'd use supabase-py. ## Authenticate @@ -170,6 +170,25 @@ supabase: Client = create_client(url, key) data = supabase.table("countries").delete().eq("id", 1).execute() ``` +### Supabase Functions + +```python +from supabase import create_client, Client + +url: str = os.environ.get("SUPABASE_TEST_URL") +key: str = os.environ.get("SUPABASE_TEST_KEY") +supabase: Client = create_client(url, key) +func = supabase.functions() + +@asyncio.coroutine +async def test_func(loop): + resp = await func.invoke("hello-world",invoke_options={'body':{}}) + return resp + +loop = asyncio.get_event_loop() +resp = loop.run_until_complete(test_func(loop)) +loop.close() +``` ## Realtime Changes