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.1.0.tar.gz (5.5 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.1.0-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for flai_sdk-1.1.0.tar.gz
Algorithm Hash digest
SHA256 64ba0c2616ec88b2ce3c130416deb273de1c8240040c7669585d624ad6e2c3f6
MD5 9ee07d3eae58e0d1906fb52c63bc0218
BLAKE2b-256 4699c6984df2f7933e4c2b723c01378af7abf9e35a8a401e163f60af7c50447d

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for flai_sdk-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bebbacd1fb9c63026e9de1838fb70b70b306982ecf6d1bba0d28571cb5954761
MD5 b59e8d0d51deff69e2c532134ff09492
BLAKE2b-256 81392490de96f5d5d94f63d5228f0591b6fa5112f81cd65a584ed420ca779f18

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