Filestack Python SDK

raw JSON →
4.0.0 verified Mon Apr 27 auth: no python

A Python SDK for the Filestack API, providing file upload, transformation, and delivery services. Version 4.0.0 is the latest major release with async support and reorganized client architecture. Releases are semi-regular with breaking changes between major versions.

pip install filestack-python
error ModuleNotFoundError: No module named 'filestack'
cause The package is installed as 'filestack-python' but imported as 'filestack'.
fix
pip install filestack-python and use import filestack. Do not try to import 'filestack-python' directly.
error ImportError: cannot import name 'FilestackClient' from 'filestack'
cause Using old v3 import pattern with v4 installed.
fix
Use: from filestack import Client
error TypeError: upload() missing 1 required positional argument: 'filepath'
cause The upload method requires a filepath or file-like object as first argument.
fix
Provide the filepath argument: client.upload(filepath='path/to/file.pdf')
breaking v4 introduces a breaking change: the module structure changed. 'filestack' now exports 'Client' directly, replacing the old 'FilestackClient' from 'filestack-python' in v3.
fix Update import: from filestack import Client (instead of from filestack import FilestackClient).
gotcha The upload method in v4 returns a Filelink object, not a dict. Accessing the URL requires .url attribute.
fix Use filelink.url instead of filelink['url'].
gotcha API key is required even for public uploads unless using a security policy. The Client constructor expects the API key as the first positional argument.
fix Always pass your API key: Client('your-api-key').
deprecated v4 removed the 'Filestack' class and the 'filestack-python' top-level package. Use 'filestack' only.
fix pip install filestack-python and import from filestack.

Initialize the client with your API key and upload a file.

import os
from filestack import Client

api_key = os.environ.get('FILESTACK_API_KEY', '')
client = Client(api_key)

# upload a file
filelink = client.upload(filepath='path/to/file.pdf')
print(filelink.url)