Giter Club home page Giter Club logo

python-frameio-client's Introduction

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

via Source

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

Developing

Install the package into your development environment and link to it by running the following:

pipenv install -e . -pre

Documentation

Frame.io API Documentation

Use CLI

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

To upload a file or folder

fioctl \
--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

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

Links

Sphinx Documentation

Decorators

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.

from frameioclient import FrameioClient

client = FrameioClient("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

client = FrameioClient("TOKEN")


# Create a new asset manually
asset = client.assets.create(
  parent_asset_id="1234abcd",
  name="MyVideo.mp4",
  type="file",
  filetype="video/mp4",
  filesize=os.path.getsize("sample.mp4")
)

# Create a new folder
client.assets.create(
  parent_asset_id="",
  name="Folder name",
  type="folder" # this kwarg is what makes it a folder
)

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

python-frameio-client's People

Contributors

jhodges10 avatar jhurtadosandoval avatar jpylisela avatar kylenstone avatar michaeljguarino avatar mjiggidy avatar mrbaehr avatar robertcodes avatar sjkaliski avatar strombergdev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

python-frameio-client's Issues

Pagination is not supported

How to reproduce:

Add the parameter per_page to a call (for example get_asset_children(id, page_size=1)), This parameter is passed inside the payload (not the GET parameter) and it returns a page_size of 50.

Moreover the PaginatedResponse class is not able to load next and previous pages.

error issue

tree = client.helpers.build_project_tree(project_id, slim=True)

'FrameioClient' object has no attribute 'helpers'
File "E:\temp\client.py", line 19, in demo_folder_tree
tree = client.helpers.build_project_tree(project_id, slim=True)
File "E:\temp\client.py", line 34, in
demo_folder_tree(project_id)
AttributeError: 'FrameioClient' object has no attribute 'helpers'

update_asset(self, asset_id, **kwargs) error

The endpoint for the update_asset(self, asset_id, **kwargs) method is incorrect.

Currently it is:
endpoint = '/assets/{}/children'.format(asset_id)

which raises a requests.exceptions.HTTPError: 404 Client Error

The correct endpoint should remove /children and is:

endpoint = '/assets/{}'.format(asset_id)

"method_whitelist" error

Hello,

Executing in Python 3.10, line 48 of frameioclient/lib/transport.py is giving us problems when initializing a FrameIOClient instance:

TypeError: Retry.__init__() got an unexpected keyword argument 'method_whitelist'

Python3.8 serializing error: TypeError: cannot pickle '_io.BufferedReader' object

When trying to upload a file using the docs recommendation the script triggers the following error:

Traceback (most recent call last): File "frameio.py", line 26, in <module> client.upload(asset, file) File "/usr/local/lib/python3.8/site-packages/frameioclient/client.py", line 224, in upload uploader.upload() File "/usr/local/lib/python3.8/site-packages/frameioclient/upload.py", line 33, in upload proc.start() File "/usr/local/Cellar/[email protected]/3.8.1/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/process.py", line 121, in start self._popen = self._Popen(self) File "/usr/local/Cellar/[email protected]/3.8.1/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/context.py", line 224, in _Popen return _default_context.get_context().Process._Popen(process_obj) File "/usr/local/Cellar/[email protected]/3.8.1/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/context.py", line 283, in _Popen return Popen(process_obj) File "/usr/local/Cellar/[email protected]/3.8.1/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 32, in __init__ super().__init__(process_obj) File "/usr/local/Cellar/[email protected]/3.8.1/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/popen_fork.py", line 19, in __init__ self._launch(process_obj) File "/usr/local/Cellar/[email protected]/3.8.1/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 47, in _launch reduction.dump(process_obj, fp) File "/usr/local/Cellar/[email protected]/3.8.1/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/reduction.py", line 60, in dump ForkingPickler(file, protocol).dump(obj) TypeError: cannot pickle '_io.BufferedReader' object

My quick guess would be the multiprocessing library used on the "upload.py" file, I'm not sure that works on py38.

For the record, I've used python3.7 on the same script and worked fine.

Upload assets not working using Python

I am using Python 3.7 on windows 10.

from frameioclient import FrameioClient
import os

client = FrameioClient("MY_TOKEN_HERE")

mov = "D:/Development/rc/frameio/a.mp4"
filesize = os.path.getsize(mov)

# Create a new asset.
asset = client.create_asset(
  parent_asset_id="MY_ASSET_ID",
  name="MyVideo.mp4",
  type="file",
  filetype="video/mp4",
  filesize=filesize
)

# Upload the file at the target asset.
file = open(mov, "rb")
client.upload(asset, file)

When I am trying to upload .mp4 file using python file getting error.

D:\Development\rc\frameio\venv\Scripts\python.exe D:/Development/rc/frameio/demo01.py
Traceback (most recent call last):
File "D:/Development/rc/frameio/demo01.py", line 20, in
client.upload(asset, file)
File "D:\Development\rc\frameio\venv\lib\site-packages\frameioclient\client.py", line 238, in upload
uploader.upload()
File "D:\Development\rc\frameio\venv\lib\site-packages\frameioclient\upload.py", line 33, in upload
proc.start()
File "C:\Program Files\Python37\lib\multiprocessing\process.py", line 112, in start
self._popen = self._Popen(self)
File "C:\Program Files\Python37\lib\multiprocessing\context.py", line 223, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "C:\Program Files\Python37\lib\multiprocessing\context.py", line 322, in _Popen
return Popen(process_obj)
File "C:\Program Files\Python37\lib\multiprocessing\popen_spawn_win32.py", line 89, in init
reduction.dump(process_obj, to_child)
File "C:\Program Files\Python37\lib\multiprocessing\reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)
TypeError: cannot serialize '_io.BufferedReader' object

Cannot reply to existing comments

Per Kyle Stone, there is an undocumented API route, which enables you to post a child comment in response to a parent comment:

https://api.frame.io/v2/comments/<PARENT_COMMENT_ID>/replies

I am working on this, and will issue a pull request shortly!

Pypi.org Package Version out of Date

Hello,

The package version on pypi.org is out of date and needs a new release.
The current git repo doesn't even have the version from pypi.org.

There are a couple of outstanding pull requests that would need to be approved first to make it usable as a package though.
For example: #96 and #95

Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.