Skip to main content

Client library for the Frame.io API

Project description

python-frameio-client

PyPI version PyPI pyversions

artboard_small

Frame.io

Frame.io is a cloud-based collaboration hub that allows video professionals to share files, comment on clips real-time, and compare different versions and edits of a clip.

Overview

Installation

via pip

$ pip install frameioclient

from source

$ git clone https://github.com/frameio/python-frameio-client
$ pip install -e .

Documentation

Frame.io API Documentation

Use CLI

When you install this package, a cli tool called fioctfioclil will also be installed to your environment.

To upload a file or folder

fiocli \
--token fio-u-YOUR_TOKEN_HERE  \
--destination "YOUR TARGET FRAME.IO PROJECT OR FOLDER" \
--target "YOUR LOCAL SYSTEM DIRECTORY" \
--threads 8

To download a file, project, or folder

fiocli \
--token fio-u-YOUR_TOKEN_HERE  \
--destination "YOUR LOCAL SYSTEM DIRECTORY" \
--target "YOUR TARGET FRAME.IO PROJECT OR FOLDER" \
--threads 2

Usage

Note: A valid token is required to make requests to Frame.io. Go to our Developer Portal to get a token!

In addition to the snippets below, examples are included in /examples.

Get User Info

Get basic info on the authenticated user.

import os
from frameioclient import FrameioClient

# We always recommend passing the token you'll be using via an environment variable and accessing it using os.getenv("FRAMEIO_TOKEN")
FRAMEIO_TOKEN = os.getenv("FRAMEIO_TOKEN")
client = FrameioClient(FRAMEIO_TOKEN)

me = client.users.get_me()
print(me['id'])

Create and Upload Asset

Create a new asset and upload a file. For parent_asset_id you must have the root asset ID for the project, or an ID for a folder in the project. For more information on how assets work, check out our docs.

import os
from frameioclient import FrameioClient

# We always recommend passing the token you'll be using via an environment variable and accessing it using os.getenv("FRAMEIO_TOKEN")
FRAMEIO_TOKEN = os.getenv("FRAMEIO_TOKEN")
client = FrameioClient(FRAMEIO_TOKEN)


# Create a new asset manually
client.assets.create(
  parent_asset_id="0d98e024-d738-4d9a-ae89-19f02839116d",
  name="MyVideo.mp4",
  type="file",
  filetype="video/mp4",
  filesize=os.path.getsize("sample.mp4")
)

# Create a new folder
client.assets.create_folder(
  parent_asset_id="63bfd7cc-8517-4a61-b655-0a59f5dec630",
  name="Folder name",
)

# Upload a file 
client.assets.upload(destination_id, "video.mp4")

Contributing

Install the package into your development environment using Poetry. This should auto-link it within the current virtual-env that gets created during installation.

poetry install

Ancillary links

Sphinx Documentation

Decorators

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

frameioclient-2.0.1a5.tar.gz (26.0 kB view hashes)

Uploaded Source

Built Distribution

frameioclient-2.0.1a5-py3-none-any.whl (34.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page