@@ -206,6 +206,82 @@ resp = loop.run_until_complete(test_func(loop))
206
206
loop.close()
207
207
```
208
208
209
+ ## Storage
210
+
211
+ ### Download a file
212
+
213
+ ``` python
214
+ from supabase import create_client, Client
215
+
216
+ url: str = os.environ.get(" SUPABASE_TEST_URL" )
217
+ key: str = os.environ.get(" SUPABASE_TEST_KEY" )
218
+ supabase: Client = create_client(url, key)
219
+
220
+ bucket_name: str = " photos"
221
+
222
+ data = supabase.storage.from_(bucket_name).download(" photo1.png)
223
+ ```
224
+
225
+ # ## Upload a file
226
+
227
+ ```python
228
+ from supabase import create_client, Client
229
+
230
+ url: str = os.environ.get(" SUPABASE_TEST_URL" )
231
+ key: str = os.environ.get(" SUPABASE_TEST_KEY" )
232
+ supabase: Client = create_client(url, key)
233
+
234
+ bucket_name: str = " photos"
235
+ new_file = getUserFile()
236
+
237
+ data = supabase.storage.from_(bucket_name).upload(" /user1/profile.png" , new_file)
238
+ ```
239
+
240
+ # ## Delete a file
241
+
242
+ ```python
243
+ from supabase import create_client, Client
244
+
245
+ url: str = os.environ.get(" SUPABASE_TEST_URL" )
246
+ key: str = os.environ.get(" SUPABASE_TEST_KEY" )
247
+ supabase: Client = create_client(url, key)
248
+
249
+ bucket_name: str = " photos"
250
+
251
+ data = supabase.storage.from_(bucket_name).delete([" old_photo.png" , " image5.jpg" ])
252
+ ```
253
+
254
+ # ## List all files
255
+
256
+ ```python
257
+ from supabase import create_client, Client
258
+
259
+ url: str = os.environ.get(" SUPABASE_TEST_URL" )
260
+ key: str = os.environ.get(" SUPABASE_TEST_KEY" )
261
+ supabase: Client = create_client(url, key)
262
+
263
+ bucket_name: str = " charts"
264
+
265
+ data = supabase.storage.from_(bucket_name).list()
266
+ ```
267
+
268
+ # ## Move and rename file
269
+
270
+ ```python
271
+ from supabase import create_client, Client
272
+
273
+ url: str = os.environ.get(" SUPABASE_TEST_URL" )
274
+ key: str = os.environ.get(" SUPABASE_TEST_KEY" )
275
+ supabase: Client = create_client(url, key)
276
+
277
+ bucket_name: str = " charts"
278
+ old_file_path: str = " generic/graph1.png"
279
+ new_file_path: str = " important/revenue.png"
280
+
281
+ data = supabase.storage.from_(bucket_name).move(old_file_path, new_file_path)
282
+ ```
283
+
284
+
209
285
# # Realtime Changes
210
286
211
287
Realtime changes are unfortunately still a WIP . Feel free to file PRs to [realtime- py](https:// github.com/ supabase- community/ realtime- py)
0 commit comments