Skip to main content

Python SDK for the Infuse Video API

Project description

infusevideo-sdk

This is the Infuse Video SDK for Python.

At the moment, this is a very basic initial version that takes care of authentication, and otherwise exposes a simple REST client. More features and documentation are going to come soon.

Requirements

Installation

It's always advisable to setup a virtualenv when working with third-party packages, in order to keep this package and dependencies from cluttering the globally installed packages, and vice versa. If you do not know how to set one up, refer to the Python documentation on venv.

After creating and also activating the virtualenv, installation is as simple as

pip install infusevideo-sdk

This will install a package named infusevideo, containing the SDK, into the virtualenv.

Upgrading

Upgrading is as simple as running

pip install --upgrade infusevideo-sdk

Usage

In the current state, this is a simple wrapper around a REST/HTTP client. The InfuseVideo class exposes five methods (get, post, patch, put and delete) indicating their respective HTTP counterparts.

API documentation

Please refer to the current API documentation for an overview of available actions on the API, request parameters and expected return values. Authentication is already taken care of by the SDK, so that section of the API documentation may be skipped.

Example code

Simple code that calls the List media route on the Media endpoint:

import infusevideo

api = infusevideo.InfuseVideo()
result = api.get("/media")
print(result)

Create a new Media and upload a video file:

import infusevideo

api = infusevideo.InfuseVideo()
result = api.post("/media", data={"name": "A name", "metadata": "Example metadata"})
mediaId = result["mediaId"]

result = api.put(f"/media/{mediaId}", fileName="/path/to/my/file.mp4")
print(result)

Creating a sample configuration file

By default, the SDK will connect to the API, ask for your credentials interactively, and attempt to obtain an authorization token with all permissions that were granted to you. If you have access to multiple accounts, the token will be valid only for your default account. In order to easily use multiple accounts, choose a different, limited, set of permissions or use non-interactive M2M authentication, you will need to customise a profile in the configuration file. This configuration file is normally located in the .infusevideo/ directory in your home directory. If you have not yet created this file, you can do so using the following code:

import infusevideo

path = infusevideo.Config.generate_sample_config()
print(path)

This will create a sample configuration file with a default profile and a separate sample profile for M2M authentication. It will then print the path where the configuration file was created, for future reference. There will be some inline comments explaining the various configuration options that are available.

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

infusevideo-sdk-0.3.0.tar.gz (13.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

infusevideo_sdk-0.3.0-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

Details for the file infusevideo-sdk-0.3.0.tar.gz.

File metadata

  • Download URL: infusevideo-sdk-0.3.0.tar.gz
  • Upload date:
  • Size: 13.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for infusevideo-sdk-0.3.0.tar.gz
Algorithm Hash digest
SHA256 db8020c9fe572c99fecd273e540b5f1fa0fe9e7742368b88c182daa1c7e69bad
MD5 4e6101a6cef9c08e3260a94ab36c231f
BLAKE2b-256 3768c84131900a1211d57330dba6cf62d52bcc44a347e32a4e74c78ec280ce6f

See more details on using hashes here.

File details

Details for the file infusevideo_sdk-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for infusevideo_sdk-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c4b49b1bc42135ec39d0aee9dfedfc55d044c6b36b1d854e65020fad48924590
MD5 279dedfcdce6b25dece656ba09b7bee1
BLAKE2b-256 a3e9d5fcf41aeafb4f94d7c094fc2449a49206e69a21c27d664b9e3a8ab4760f

See more details on using hashes here.

Supported by

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