supabase-py
supabase-py copied to clipboard
Fully wrapped supabase-js working (I think)
trafficstars
Since a lot is missing (For me, realtime), I tried this:
import os
import asyncio
from javascript import require
url = os.environ.get("SUPABASE_URL")
key = os.environ.get("SUPABASE_KEY")
supa_id = os.environ.get("SUPABASE_ID")
def callback1(*args, **kwargs):
print("Callback: ", args)
async def main() -> None:
createClient = require("@supabase/supabase-js").createClient
supabase = createClient(url, key)
supabase \
.channel('any') \
.on('postgres_changes', {
'event': '*',
'schema': 'public',
'table': '*'
}, callback1) \
.subscribe()
while True:
await asyncio.sleep(1)
if __name__ == "__main__":
asyncio.run(main())
and it worked quite well! I haven't tested every feature yet but it's doing what I need it to at the moment. Might be worth mentioning in the readme.
Good god what is this dark magic? I had never heard of that library. I love it
We currently have most of the features in the Supabase Python library itself. So this isn't necessary anymore. Closing this one out.