Skip to main content

Flai SDK

The Flai SDK is a command-line toolset for interacting with the Flai web app. It is also used by our QGIS plugin.

Install

From PyPI

pip install flai-sdk

From source

  1. Clone the repo and enter the directory:

    git clone https://github.com:flai-ai/flai-sdk.git
    cd flai-sdk
    
  2. (Optional) Create and activate a virtual environment.

    With Conda

    conda create --name flai-sdk
    conda activate flai-sdk
    

    With venv

    python3(.VERSION) -m venv ~/.python-virtual-env/flai-sdk
    source ~/.python-virtual-env/flai-sdk/bin/activate
    
  3. Install in “editable” mode in it's directory:

    pip install -e .

Developer setup

After cloning, enable the repo's git hooks (enforces semver on tags/releases):

git config core.hooksPath .githooks

First-time setup

To use our package you will need to call login command and pass at least two arguments for authorization (see Tips below).

flai-sdk login

This command will create a json file under path $HOME/.flai (Linux / macOS / Windows - Powershell) or %USERPROFILE%/.flai (Windows - cmd).

Tips:

  • flai_access_token
    • can be found on Flai web app or
    • by going to our Web App at flai.ai > Sign in > Click your icon > Select Settings from menu > Click Access tokens tab > Click Add new personal access token
  • flai_host

Examples

Upload a dataset to a project

Upload all .las/.laz files in the current folder to a project.

# simple example
flai-sdk upload-dataset --project_id PROJECT_NAME --dataset_name DATASET_NAME FILES

# working example
flai-sdk upload-dataset --project_id "Staring project" --dataset_name "Testing upload" "*.la?"

# compact version
flai-sdk upload-dataset -p "Staring project" -n "Testing upload" "*.la?"

The flag --project_id / -p can be omitted. In this case, the data will not be assigned to a project and will be shown in the catalog on your instance of our web app.

Download dataset

flai-sdk download-dataset -d "59d66bfc-c2a4-4e91-91f3-2f469078297b" "downloaded files.zip"

Explore commands

To see what arguments our SDK expects you can start from initial command and then add --help to see more hints.

# to see all available options
flai-sdk --help

# let's say we want to know what option 'download-flainet-model' expects
flai-sdk download-flainet-model --help

# and that is it :)

TODO

Cortex

Rewrite typed classes to pydantic model to match rest of flai-cortex. https://gitlab.com/flai-ai/dev/flai-cortex/-/work_items/35

Metadata

Release files for flai-sdk 1.3.13

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flai-sdk 1.3.13
File Size Uploaded
flai_sdk-1.3.13.tar.gz 46.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for flai-sdk 1.3.13
File Interpreter ABI Platform
flai_sdk-1.3.13-py3-none-any.whl Python 3 none any Details

Total release size: 103.0 kB

Release files / flai_sdk-1.3.13.tar.gz

Download URL flai_sdk-1.3.13.tar.gz
Size 46.8 kB
Tags Source
SHA-256 checksum
How to use checksums
81b4557695c595c8c3623b7d9631d2e4128152c9f302504abaaabd5bad918788
BLAKE2b-256 checksum
How to use checksums
48c9ed203bc54fc6c34e3c0da9efa2bbfa58f1c5a61f7f06970158cae140d231
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / flai_sdk-1.3.13-py3-none-any.whl

Download URL flai_sdk-1.3.13-py3-none-any.whl
Size 56.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
33afea3bec41d618f3d5657687adacedbb2a898a24a00306e892c0ea8d9f0171
BLAKE2b-256 checksum
How to use checksums
fc006d08ee9587a2bcef8c8856784922905c179c88a9add329452ac789ec87b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release history Release notifications | RSS feed

This release

1.3.13 This release

2 release files

1.3.9

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page