Python SDK: StoredFile: saved file properties
storage.put() and storage.put_from_url() return a StoredFile SDK object. Read its public properties, not dictionary keys. They describe the result of the call and require no new request.
| Property | Type | Meaning |
|---|---|---|
key |
str |
Final object key chosen by the storage connection. It may differ from the suggested key. |
url |
str | None |
Available object URL; do not assume a private object is public. |
size |
int |
Stored payload size in bytes. |
mime |
str | None |
Content type reported by the storage operation. |
etag |
str | None |
Object identifier/checksum reported by storage; its format depends on the provider. |
dry_run |
bool |
A trial operation was simulated instead of writing to the external destination. |
stored = ctx.storage('media').put('reports/summary.txt', 'Ready', 'text/plain')
ctx.log('Storage result', {'key': stored.key, 'size': stored.size, 'dry_run': stored.dry_run})
Do not emit StoredFile itself. Select the fields needed by your schema. To obtain a new expiring URL for a private object, call ctx.storage('media').url(stored.key, 3600). Do not log signed URLs when they grant access to private files.
Errors and execution context
All calls are synchronous. Invalid arguments or malformed source data can raise ValueError/TypeError; a platform refusal or unavailable service raises RuntimeError. Missing elements/values return None or an empty collection only where explicitly documented. Do not convert every exception into an empty successful result. External-service methods are unavailable in export transformations; see transformation limits and environment.