Python: Storage
Create and configure buckets, list, move and delete objects, and issue signed upload and download URLs with the Python SDK.
await sovaria.store_create_bucket({"name": "invoices", "public": False})
link = await sovaria.store_sign_download("invoices", f"{user_id}/2026-10.pdf", expires_in=3600)
print(link["url"])#Methods
sovaria.download_compliance_evidence
The evidence pack as ZIP bytes (MANIFEST.json holds each file's SHA-256).
await sovaria.download_compliance_evidence(
org_id: str | None = None,
*, project_id: str | None = None,
) -> bytesCounted per day, audited. It is evidence of how Sovaria is configured for the organization, not a certification.
Parameters
org_idstr | NoneoptionaldefaultNoneproject_idstr | NoneoptionaldefaultNone
Returns
bytes
sovaria.download_hipaa_report
The HIPAA safeguards report as ZIP bytes (hipaa_safeguards.md, hipaa.json, MANIFEST.json), judged from live data.
await sovaria.download_hipaa_report(org_id: str | None = None) -> bytesEnterprise; counted per day; audited. Evidence for your own risk analysis, not a certification.
Parameters
org_idstr | NoneoptionaldefaultNone
Returns
bytes
sovaria.store_create_bucket
Store create bucket.
await sovaria.store_create_bucket(
body: dict[str, Any],
) -> dict[str, Any]Parameters
bodydict[str, Any]required
Returns
dict[str, Any]
sovaria.store_delete
Delete a storage path.
await sovaria.store_delete(path: str) -> AnyParameters
pathstrrequired
Returns
Any
sovaria.store_delete_bucket
Store delete bucket.
await sovaria.store_delete_bucket(name: str) -> dict[str, Any]Parameters
namestrrequired
Returns
dict[str, Any]
sovaria.store_get
Read from a storage path.
await sovaria.store_get(
path: str,
*, params: dict[str, str] | None = None,
) -> AnyParameters
pathstrrequiredparamsdict[str, str] | NoneoptionaldefaultNone
Returns
Any
sovaria.store_get_bucket
Store get bucket.
await sovaria.store_get_bucket(name: str) -> dict[str, Any]Parameters
namestrrequired
Returns
dict[str, Any]
sovaria.store_list_buckets
Store list buckets.
await sovaria.store_list_buckets() -> list[dict[str, Any]]Returns
list[dict[str, Any]]
sovaria.store_list_objects
Store list objects.
await sovaria.store_list_objects(
bucket: str,
*, prefix: str = '',
limit: int | None = None,
offset: int | None = None,
) -> list[dict[str, Any]]Parameters
bucketstrrequiredprefixstroptionaldefault''limitint | NoneoptionaldefaultNoneoffsetint | NoneoptionaldefaultNone
Returns
list[dict[str, Any]]
sovaria.store_move_object
Store move object.
await sovaria.store_move_object(
from_path: str,
to_path: str,
) -> dict[str, Any]Parameters
from_pathstrrequiredto_pathstrrequired
Returns
dict[str, Any]
sovaria.store_put_json
Write JSON payload to a storage path.
await sovaria.store_put_json(path: str, payload: dict[str, Any]) -> AnyParameters
pathstrrequiredpayloaddict[str, Any]required
Returns
Any
sovaria.store_request
Call a Storage endpoint under /api/v1/store/*.
await sovaria.store_request(
method: str,
path: str,
*, json: dict[str, Any] | list[Any] | None = None,
params: dict[str, str] | None = None,
requires_auth: bool = True,
) -> AnyParameters
methodstrrequiredpathstrrequiredjsondict[str, Any] | list[Any] | NoneoptionaldefaultNoneparamsdict[str, str] | NoneoptionaldefaultNonerequires_authbooloptionaldefaultTrue
Returns
Any
sovaria.store_sign_download
Store sign download.
await sovaria.store_sign_download(
bucket: str,
object_path: str,
*, expires_in: int | None = None,
) -> dict[str, Any]Parameters
bucketstrrequiredobject_pathstrrequiredexpires_inint | NoneoptionaldefaultNone
Returns
dict[str, Any]
sovaria.store_sign_upload
Signed upload URL.
await sovaria.store_sign_upload(
bucket: str,
object_path: str,
*, expires_in: int | None = None,
size_bytes: int | None = None,
content_type: str | None = None,
) -> dict[str, Any]With size_bytes (the file's exact size) the URL goes straight to storage and is bound to that size; without it the upload goes through Sovaria.
Parameters
bucketstrrequiredobject_pathstrrequiredexpires_inint | NoneoptionaldefaultNonesize_bytesint | NoneoptionaldefaultNonecontent_typestr | NoneoptionaldefaultNone
Returns
dict[str, Any]
sovaria.store_update_bucket
Store update bucket.
await sovaria.store_update_bucket(
name: str,
body: dict[str, Any],
) -> dict[str, Any]Parameters
namestrrequiredbodydict[str, Any]required
Returns
dict[str, Any]
#Ergonomic client
Dot-access object storage that mirrors the Dart and TypeScript clients: storage = StorageClient(sovaria), then one handle per bucket with bucket = storage.bucket("avatars"). StorageClient also exposes flat storage.upload(bucket, path, …) / download / remove / list / create_signed_url / public_url convenience methods that take the bucket name first.
`StorageClient`
storage.bucket
Return a :class:BucketRef handle for the named bucket.
storage.bucket(name: str) -> BucketRefParameters
namestrrequired
Returns
BucketRef
storage.from_
supabase-py's name for :meth:bucket: sov.storage.from_("avatars").upload(...).
storage.from_(name: str) -> BucketRefParameters
namestrrequired
Returns
BucketRef
storage.s3_info
{"enabled", "endpoint", "region", "keys": [...]} for this project (plan-gated).
await storage.s3_info() -> dict[str, Any]Returns
dict[str, Any]
storage.create_s3_key
A new access key.
await storage.create_s3_key(name: str) -> dict[str, Any]secret_access_key is in this answer only: store it now.
Parameters
namestrrequired
Returns
dict[str, Any]
storage.revoke_s3_key
Revoke an access key at once (S3 calls signed with it are refused).
await storage.revoke_s3_key(access_key_id: str) -> NoneParameters
access_key_idstrrequired
Returns
None
storage.list_buckets
List buckets.
await storage.list_buckets() -> list[dict[str, Any]]Returns
list[dict[str, Any]]
storage.get_bucket
Get bucket.
await storage.get_bucket(id: str) -> dict[str, Any]Parameters
idstrrequired
Returns
dict[str, Any]
storage.create_bucket
create_bucket("avatars", {"public": True, "file_size_limit": "5MB", "allowed_mime_types": ["image/*"]}).
await storage.create_bucket(
id: str,
options: Mapping[str, Any] | None = None,
) -> dict[str, Any]Parameters
idstrrequiredoptionsMapping[str, Any] | NoneoptionaldefaultNone
Returns
dict[str, Any]
storage.update_bucket
Update bucket.
await storage.update_bucket(
id: str,
options: Mapping[str, Any],
) -> dict[str, Any]Parameters
idstrrequiredoptionsMapping[str, Any]required
Returns
dict[str, Any]
storage.delete_bucket
Delete bucket.
await storage.delete_bucket(id: str) -> dict[str, Any]Parameters
idstrrequired
Returns
dict[str, Any]
storage.empty_bucket
Delete every file and keep the bucket (1,000 files per round, repeated until empty).
await storage.empty_bucket(id: str) -> dict[str, Any]Parameters
idstrrequired
Returns
dict[str, Any]
`BucketRef`
bucket.upload_resumable
A large file in chunks that survive a dropped connection (/api/v1/store/resumable, tus-style).
Pass upload_id (from on_progress or an earlier result) to carry on from the server's offset.
await bucket.upload_resumable(
path: str,
data: bytes,
*, content_type: str = 'application/octet-stream',
chunk_size: int = 6291456,
upload_id: str | None = None,
on_progress: Callable[[dict[str, Any]], None] | None = None,
) -> dict[str, Any]Returns {"path", "full_path", "upload_id"}.
Parameters
pathstrrequireddatabytesrequiredcontent_typestroptionaldefault'application/octet-stream'chunk_sizeintoptionaldefault6291456upload_idstr | NoneoptionaldefaultNoneon_progressCallable[[dict[str, Any]], None] | NoneoptionaldefaultNone
Returns
dict[str, Any]
bucket.upload
Upload data (bytes, a file object or a file path) to bucket/path (multipart).
await bucket.upload(
path: str,
data: Any,
file_options: Mapping[str, Any] | None = None,
*, content_type: str | None = None,
upsert: bool = False,
cache_control: str | int | None = None,
) -> dict[str, Any]upsert replaces an existing object (without it, an existing object is a 409). supabase-py's file_options ({"content-type": ..., "upsert": "true", "cache-control": "3600"}) work too.
Parameters
pathstrrequireddataAnyrequiredfile_optionsMapping[str, Any] | NoneoptionaldefaultNonecontent_typestr | NoneoptionaldefaultNoneupsertbooloptionaldefaultFalsecache_controlstr | int | NoneoptionaldefaultNone
Returns
dict[str, Any]
bucket.update
Replace an object (upload with upsert).
await bucket.update(
path: str,
data: Any,
file_options: Mapping[str, Any] | None = None,
) -> dict[str, Any]Parameters
pathstrrequireddataAnyrequiredfile_optionsMapping[str, Any] | NoneoptionaldefaultNone
Returns
dict[str, Any]
bucket.download
Download an object the caller may read.
await bucket.download(
path: str,
options: Mapping[str, Any] | None = None,
) -> bytesReturns the raw bytes. {"transform": {"width": 200, ...}} downloads a resized image (paid plans).
Parameters
pathstrrequiredoptionsMapping[str, Any] | NoneoptionaldefaultNone
Returns
bytes
bucket.move
Rename/move a file ({"destination_bucket": ...} for another bucket).
await bucket.move(
from_path: str,
to_path: str,
options: Mapping[str, Any] | None = None,
) -> dict[str, Any]Parameters
from_pathstrrequiredto_pathstrrequiredoptionsMapping[str, Any] | NoneoptionaldefaultNone
Returns
dict[str, Any]
bucket.copy
Copy a file (the copy meets the destination bucket's rules).
await bucket.copy(
from_path: str,
to_path: str,
options: Mapping[str, Any] | None = None,
) -> dict[str, Any]{"destination_bucket", "upsert"}.
Parameters
from_pathstrrequiredto_pathstrrequiredoptionsMapping[str, Any] | NoneoptionaldefaultNone
Returns
dict[str, Any]
bucket.create_signed_upload_url
A one-time upload URL (an hour at most): {"signed_url", "token", "path"}.
await bucket.create_signed_upload_url(
path: str,
options: Mapping[str, Any] | None = None,
) -> dict[str, Any]Hand token to upload_to_signed_url.
Parameters
pathstrrequiredoptionsMapping[str, Any] | NoneoptionaldefaultNone
Returns
dict[str, Any]
bucket.upload_to_signed_url
Upload with a token from create_signed_upload_url (no session needed).
await bucket.upload_to_signed_url(
path: str,
token: str,
data: Any,
file_options: Mapping[str, Any] | None = None,
) -> dict[str, Any]Parameters
pathstrrequiredtokenstrrequireddataAnyrequiredfile_optionsMapping[str, Any] | NoneoptionaldefaultNone
Returns
dict[str, Any]
bucket.info
A file's size, type, cache control, etag and dates, without downloading it.
await bucket.info(path: str) -> dict[str, Any]Parameters
pathstrrequired
Returns
dict[str, Any]
bucket.exists
True when the file is there and this user may read it.
await bucket.exists(path: str) -> boolParameters
pathstrrequired
Returns
bool
bucket.remove
Delete one object, or several (remove(["a.png", "b.png"]) as in supabase-py).
await bucket.remove(path: str | Iterable[str]) -> list[dict[str, Any]]Returns the removed ones; a file that isn't there is skipped. When others fail, every file is still tried and the error lists the ones that failed (exc.detail["failed"]) next to those deleted (exc.detail["deleted"]).
Parameters
pathstr | Iterable[str]required
Returns
list[dict[str, Any]]
bucket.list
List objects in this bucket, newest paging first.
await bucket.list(
path: str | None = None,
options: Mapping[str, Any] | None = None,
*, prefix: str | None = None,
limit: int = 100,
offset: int = 0,
) -> list[dict[str, Any]]prefix= gives full names; supabase-py's list("folder", {"limit": 10, "search": "cat"}) gives names relative to the folder.
Parameters
pathstr | NoneoptionaldefaultNoneoptionsMapping[str, Any] | NoneoptionaldefaultNoneprefixstr | NoneoptionaldefaultNonelimitintoptionaldefault100offsetintoptionaldefault0
Returns
list[dict[str, Any]]
bucket.create_signed_url
A time-limited download URL (for an <img> src, sharing, …).
await bucket.create_signed_url(
path: str,
expires_in: int = 3600,
options: Mapping[str, Any] | None = None,
) -> SignedUrlA string that also answers ["signedURL"] like supabase-py's result. {"download": True | "name.png", "transform": {...}}.
Parameters
pathstrrequiredexpires_inintoptionaldefault3600optionsMapping[str, Any] | NoneoptionaldefaultNone
Returns
SignedUrl
bucket.create_signed_urls
Signed URLs for several objects: [{"path", "signedURL", "error"}].
await bucket.create_signed_urls(
paths: Iterable[str],
expires_in: int = 3600,
) -> list[dict[str, Any]]Parameters
pathsIterable[str]requiredexpires_inintoptionaldefault3600
Returns
list[dict[str, Any]]
bucket.public_url
URL of an object in a *public* bucket.
bucket.public_url(path: str) -> strNeeds the project id (call resolve_scope() or set_scope() first).
Parameters
pathstrrequired
Returns
str
bucket.get_public_url
supabase-py's name for :meth:public_url.
bucket.get_public_url(
path: str,
options: Mapping[str, Any] | None = None,
) -> str{"download": True | "name", "transform": {"width": 200}}.
Parameters
pathstrrequiredoptionsMapping[str, Any] | NoneoptionaldefaultNone
Returns
str