Python SDK

Upload, Transform and Deliver files using Python programming language.


Full source code can be found on GitHub. Please see Python API Reference for more information about this SDK.


Install filestack package with pip

pip install --upgrade filestack-python

or directly from GitHub

pip install git+

If you don’t have pip installed you can install it by running this command:

curl -o

You can also install Filestack SDK from source code with:

python install


Python 2.7+ or Python 3.3+


The library needs to be configured with your API key which is available in your Filestack Developer Portal.

Configuring API key

from filestack import Client
client = Client("<YOUR_API_KEY>")


Security may be required for certain API requests, such as overwrite and delete, or if security has been enabled for the application. Security is set on Client or Filelink classes upon instantiation.

from filestack import security

json_policy = {"expiry": 253381964415}
security = security(json_policy, "<YOUR_APP_SECRET>")
client = Client("<YOUR_API_KEY", security=security)


Upload from file

params = {"mimetype": "image/png"}
new_filelink = client.upload(filepath="path/to/file", params=params)

Uploading local files will use Filestack’s multipart upload by default. To disable, just set the argument multipart to False.

new_filelink = client.upload(filepath="path/to/file", multipart=False)

Upload from url

new_filelink = client.upload(url="https://URL_TO_FILE")

Intelligent Ingestion

To upload files using Filestack Intelligent Ingestion, simply add intelligent=True argument

new_filelink = client.upload(filepath="path/to/file", intelligent=True)

Intelligent Ingestion always uses multipart uploads. In case of network issues, it will dynamically split file parts into smaller chunks.

You can create Filelink object from existing handle.

from filestack import Filelink
new_filelink = Filelink("<YOUR_HANDLE>")

With a Filelink, you can perform File API operations. You can download file to a local path:

response ="/path/to/file")

Get content of a file.

file_content = new_filelink.get_content()

Overwrite it. This action requires security


Or delete it. This action requires security



You can chain Processing API transformations on Filelinks, External URLs and Storage Aliases. Storing transformations will return a new Filelink object.

transform = client.transform_external("http://<SOME_URL>")
new_filelink = transform.resize(width=500, height=500).flip().enhance().store()

filelink = Filelink("<YOUR_HANDLE">)
new_filelink = filelink.resize(width=500, height=500).flip().enhance().store()

You can also retrieve the transformation url at any point.

transform_candidate = client.transform_external("http://<SOME_URL>")
transform = transform_candidate.resize(width=500, height=500).flip().enhance()

Audio/Video Convert

Audio and video conversion works just like any transformation, except it returns an instance of class AudioVisual, which allows you to check the status of your video conversion, as well as get its UUID and timestamp.

av_object = filelink.av_convert(width=100, height=100)
while (av_object.status != "completed"):

The status property makes a call to the API to check its current status, and you can call to_filelink() once video is complete (this function checks its status first and will fail if not completed yet).

filelink = av_object.to_filelink()