All I want to do is encrypt a pandas dataframe (done easily below with cryptpandas), and then upload it to the cloud (in this case, supabase).

This might be a silly question, but how do I get the encrypted dataframe as a python object, so I can save it to supabase, instead of encrypting then saving to the disc in one step?

from supabase import create_client, Client
import cryptpandas as crp

url = "url.supabase.co"
key = "key"
supabase: Client = create_client(url, key)
bucket_name: str = "bucket"

df = pd.DataFrame([[1, 1], ["a", "b"]])
crp.to_encrypted(df.astype(str), password='mypassword123', path='file.crypt')

data = supabase.storage.from_(bucket_name).upload("file.crypt", [python_object)]

0

There are 0 answers