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
-
Clone the repo and enter the directory:
git clone https://github.com:flai-ai/flai-sdk.git cd flai-sdk
-
(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
-
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 youricon> SelectSettingsfrom menu > ClickAccess tokenstab > ClickAdd new personal access token
flai_host- set it to https://api.flai.ai/
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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flai_sdk-1.1.1.tar.gz.
File metadata
- Download URL: flai_sdk-1.1.1.tar.gz
- Upload date:
- Size: 22.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83adc245dbdbceb592ad6a7794959540c74c250df39c10223332b251e4bccdcb
|
|
| MD5 |
a61715058570b41e1f479cba82b2092a
|
|
| BLAKE2b-256 |
c0b129b4adf789c45c9c411c8924008ad955fbdb53e2c97830c01caa9001f6ca
|
File details
Details for the file flai_sdk-1.1.1-py3-none-any.whl.
File metadata
- Download URL: flai_sdk-1.1.1-py3-none-any.whl
- Upload date:
- Size: 32.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5169f03395d30d78c01e1d984341f48e5bad4227948629708ff9db68ea617531
|
|
| MD5 |
3b8b0834c44edc00968a72d8cb5b463b
|
|
| BLAKE2b-256 |
df0716baffd6b0d652fe6bf5a78b59662b7507d354b837403f4c293691249edb
|