Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Commit 75c9c43

Browse files
authored
Sync support (#1)
* deps: update black, add unasync * feat: make BaseBucket * feat: rework bucket, file APIs * fix: avoid circular import on StorageException * deps: add dotenv * feat: pass User-Agent header with requests * fix: correct type-hint * fix: formatting * chore: update example in README
1 parent 1ab2974 commit 75c9c43

20 files changed

+1848
-424
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ repos:
3434
"--ignore-init-module-imports",
3535
]
3636

37-
- repo: https://github.com/ambv/black
38-
rev: 21.11b1
37+
- repo: https://github.com/psf/black
38+
rev: "22.3.0"
3939
hooks:
4040
- id: black
4141

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,13 @@ As it takes some effort to get the headers. We suggest that you use the storage
1010

1111

1212
```python3
13-
from storage3 import storage_client
13+
from storage3 import create_client
1414

15-
storage_client = storage_client.SupabaseStorageClient('https://<your_supabase_id>.supabase.co/storage/v1)', {'apiKey': '<your_api_key>', 'Authorization': 'Bearer <an_auth_token>'})
15+
url = "https://<your_supabase_id>.supabase.co/storage/v1"
16+
key = "<your api key>"
1617

17-
storage_client.list()
18+
# pass in is_async=True to create an async client
19+
storage_client = create_client(url, {'apiKey': key, 'Authorization': 'Bearer <an_auth_token>'}, is_async=False)
20+
21+
storage_client.list_buckets()
1822
```

0 commit comments

Comments
 (0)