Skip to main content

python sdk for Instill AI products

Project description

Overview

python sdk for Instill AI products

Unix Build Status Coverage Status PyPI License PyPI Version PyPI Downloads

[!IMPORTANT]
This SDK tool is under heavy development!!
Currently there has yet to be a stable version release, please feel free to open any issue regarding this SDK in our community repo

Setup

Requirements

  • Python 3.8+

Installation

[!WARNING]
If your host machine is on arm64 architecture(including Apple silicon machines, equipped with m1/m2 processors), there are some issues when installing grpcio within conda environment. You will have to manually build and install it like below. Read more about this issue here.

$ GRPC_PYTHON_LDFLAGS=" -framework CoreFoundation" pip install grpcio --no-binary :all:

Install it directly into an activated virtual environment:

$ pip install instill-sdk

or add it to your Poetry project:

$ poetry add instill-sdk

Check import

After installation, you can check if it has been installed correctly:

$ python
>>> import instill
>>> instill.__version__

Config Instill Core or Instill Cloud instance

Before we can start using this SDK, you will need to create and fill the host related configs, currently the config file path is ${HOME}/.config/instill/config.yaml

[!NOTE]
For each instance you are going to config, you will have to obtain an api_token, by going to Settings > API Tokens page from the console, no matter it is Instill Core or Instill Cloud.

Within the config file, you can define multiple instances with the alias of your liking, later in the SDK you can refer to this alias to switch between the instance.

hosts:
  alias1:
    url:    str
    secure: bool
    token:  str
  alias2:
    url:    str
    secure: bool
    token:  str
  ...
  ...

[!NOTE]
You will want to have exactly one instance named default. The SDK will attempt to connect to this instance initially, and later on you can swtich to other instances you specified in the config.

Example:

hosts:
  default:
    url: localhost:8080
    secure: false
    token: instill_sk***
  cloud:
    url: api.instill.tech
    secure: true
    token: instill_sk***

Usage

Comming soon

You can find a notebook example here

Contributing

Please refer to the Contributing Guidelines for more details.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

instill_sdk-0.1.0rc1.tar.gz (162.2 kB view hashes)

Uploaded Source

Built Distribution

instill_sdk-0.1.0rc1-py3-none-any.whl (243.9 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