Skip to main content

Python SDK and command-line utilities for Flix

Project description

Experimental Python SDK for Flix

This project aims to provide a fully-featured Python SDK for interacting with Flix, the story development hub from Foundry. It also comes with a command line utility for performing some common actions from the terminal.

Requirements

This version of the SDK requires:

  • Flix 7.0.0 or later
  • Python 3.10 or later

Installing

Install the SDK using pip, or the package manager of your choice:

$ pip install flix-sdk

after which the CLI utility can be accessed as flix or python -m flix.

Usage

As a command-line utility

This package comes with a flix CLI utility that lets you perform some common actions. At the moment you can use it to perform basic cURL-like requests, as well as to manage webhook.

$ flix --help
Usage: flix [OPTIONS] COMMAND [ARGS]...

Options:
  -s, --server TEXT    The URL of the Flix server.
  -u, --username TEXT  The username to authenticate with.
  -p, --password TEXT  The password to authenticate with.
  --help               Show this message and exit.

Commands:
  config        Set default configuration values.
  contactsheet  Manage contact sheet templates.
  curl          Perform cURL-like requests to a Flix server.
  logout        Log out the user from Flix by removing any active access...
  webhook       Manage webhooks.

To use the flix utility, you should configure what server and credentials to use. This is best done either using environment variables, or the flix config command.

To use environment variables, you need to set the FLIX_SERVER, FLIX_USERNAME, and FLIX_PASSWORD variables:

$ export FLIX_SERVER=http://localhost:8080
$ export FLIX_USERNAME=admin
$ export FLIX_PASSWORD=admin
$ flix curl /servers
Not signed in, attempting to authenticate...
{"servers": ...}

You can also tell flix to remember your information using flix config:

$ flix config -s http://localhost:8080 -u admin -p admin
$ flix curl /servers
Not signed in, attempting to authenticate...
{"servers": ...}

Alternatively, you can provide the information directly to the flix command:

$ flix -s http://localhost:8080 -u admin -p admin curl /servers
Not signed in, attempting to authenticate...
{"servers": ...}

If you do not configure your credentials, flix will ask for them when attempting to log in:

$ flix -s http://localhost:8080 curl /servers
Not signed in, attempting to authenticate...
Username: admin
Password:
{"servers": ...}

As a library

This package also comes with an asyncio-based library to help you interact with Flix from your own Python scripts. See the examples folder for examples of how to use it.

Versioning policy

The Flix SDK follows semantic versioning:

  • The major version is increased if a breaking change is introduced, either at the Flix API level, or in the Flix SDK itself.
  • The minor version is increased if new features are added without breaking existing functionality, with a note in the documentation explaining what Flix version is required for the new features.
  • The patch version is increased if a bug fix is made without changing functionality.

To ensure that an update will not break existing applications, we recommend specifying a dependency on flix-sdk in the form of ^1.2.3 or, equivalently, >=1.2.3 <2.0.0.

Development

This project makes use of Poetry for packaging and dependency management. You can install a local development copy along with all dependencies using the `poetry´ command:

$ pip install poetry
$ poetry install

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

flix_sdk-2.0.1.tar.gz (75.8 kB view details)

Uploaded Source

Built Distribution

flix_sdk-2.0.1-py3-none-any.whl (123.1 kB view details)

Uploaded Python 3

File details

Details for the file flix_sdk-2.0.1.tar.gz.

File metadata

  • Download URL: flix_sdk-2.0.1.tar.gz
  • Upload date:
  • Size: 75.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.12.0 Linux/5.15.0-97-generic

File hashes

Hashes for flix_sdk-2.0.1.tar.gz
Algorithm Hash digest
SHA256 d26c81fc96e3a067133fc030f0dff4d8cfdfa89a4e3a818895160f8c912a6cab
MD5 e65aaf2b7957f84dcdbbb42ee4c593d2
BLAKE2b-256 e73d6fb9671fc3454c017f738163635d02e868aa703ac83c3d8fa368b002ec21

See more details on using hashes here.

File details

Details for the file flix_sdk-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: flix_sdk-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 123.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.12.0 Linux/5.15.0-97-generic

File hashes

Hashes for flix_sdk-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 70aa6f184052d35a5987dc0279a065f8e426dd8b49b82993176110271a24ac84
MD5 b3644a2e6b7ddae1c3a62fe36cff20af
BLAKE2b-256 a8e9beb076c3cc8d9a7fd3c7746a363c4ee9a4696436e41c74456fe2c4ea3404

See more details on using hashes here.

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