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 .
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 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 :)
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.16
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| flai_sdk-1.3.16.tar.gz | 53.4 kB | Without provenance | Details for flai_sdk-1.3.16.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| flai_sdk-1.3.16-py3-none-any.whl | Python 3 | none | any | Details for flai_sdk-1.3.16-py3-none-any.whl |
Total release size: 113.4 kB
Release files / flai_sdk-1.3.16.tar.gz
| Download URL | flai_sdk-1.3.16.tar.gz |
|---|---|
| Size | 53.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6148bfb19e446e017eca77e2ae6719a88964501fbf95d0168b9c4a6811879aff
|
|
BLAKE2b-256 checksum How to use checksums |
f51b2b1dcba85df653015da7f5946ad8f04db511994808c900db69e371add983
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.15.2
|
Release files / flai_sdk-1.3.16-py3-none-any.whl
| Download URL | flai_sdk-1.3.16-py3-none-any.whl |
|---|---|
| Size | 60.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6e42fb98679c8e7fc1dc888e8fdc2d0fda7bf752711e4bca474a0f8a2a7180f6
|
|
BLAKE2b-256 checksum How to use checksums |
1a23a9672c1dc72f1fd7ac4a6ca8961c2822fff738084bee40cbf81cf89fc94f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.15.2
|
Security for flai-sdk 1.3.16
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.