Skip to main content

A command-line toolset for interacting with the Flai web app.

Project description

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 .

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 :)

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

flai_sdk-1.0.0.tar.gz (22.1 kB view details)

Uploaded Source

Built Distribution

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

flai_sdk-1.0.0-py3-none-any.whl (31.1 kB view details)

Uploaded Python 3

File details

Details for the file flai_sdk-1.0.0.tar.gz.

File metadata

  • Download URL: flai_sdk-1.0.0.tar.gz
  • Upload date:
  • Size: 22.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for flai_sdk-1.0.0.tar.gz
Algorithm Hash digest
SHA256 7afe71179e45928813245736b5222c5f490f15c230482eb04852494896ff26f4
MD5 6558e739af03e16ddfe3016a6203dd1f
BLAKE2b-256 3ad7ee1542c6720dc80ea04fe08c732f206d8b8dd56ba0c7ef8d987d41860999

See more details on using hashes here.

File details

Details for the file flai_sdk-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: flai_sdk-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 31.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for flai_sdk-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 385dbe8404fcb1c63032f381b3fb1323d16e27bb3d1afee8a99629e903d49b96
MD5 3779ff78ac79e47ecad8afcc37743797
BLAKE2b-256 463a033a0a786e2465a300ec4f573a0ea650304c22ef5155858b669274bd0f2c

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