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 .

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

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.3.9.tar.gz (34.6 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.3.9-py3-none-any.whl (45.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: flai_sdk-1.3.9.tar.gz
  • Upload date:
  • Size: 34.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for flai_sdk-1.3.9.tar.gz
Algorithm Hash digest
SHA256 22c9d21e823e64bffe8c7ed46ddfa7df6ce8a9fb12636f9f6c576e19df3fd39c
MD5 104c001a46271f24d5b7091975767e2b
BLAKE2b-256 ddc0c347ee1b4e7f86f32c5faf92dac3807893a2f3f8f2ecd54c4c446bc0ff50

See more details on using hashes here.

File details

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

File metadata

  • Download URL: flai_sdk-1.3.9-py3-none-any.whl
  • Upload date:
  • Size: 45.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for flai_sdk-1.3.9-py3-none-any.whl
Algorithm Hash digest
SHA256 24ac6f8b85d9f3c985731df702c896ec3ca91e468960f5980f7511c954f2fd71
MD5 7bcad22dba876b8f0f99647de65e600b
BLAKE2b-256 6f034010d1423583125ab982ef54018e76c97868da61ebaa3c4c09fc32a52c9a

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