fsdb_import_images
FSDB Images Import CLILink
A command‑line utility that imports the content of a folder as an 'images' Fileset to a new Scan dataset
optionally attaching metadata and providing configurable logging.
It streamlines adding new image data to a PlantDB database directly from the terminal.
Key FeaturesLink
- Simple CLI interface using
clickwith positional arguments for the target database and source folder. - Automatic scan creation: Creates a new scan dataset with the folder name or a custom name.
- Image filtering: Automatically filters for common image file extensions (.png, .jpg, .jpeg).
- Optional metadata: load a JSON file and associate its contents with the imported fileset.
- Configurable logging: choose from predefined log levels to control output verbosity.
- Automatic database handling: connects to the FSDB, creates the necessary scan/fileset hierarchy, imports the files, applies metadata, and cleanly disconnects.
- Login support: authenticate with username/password or use no-auth for testing.
Usage ExamplesLink
Basic import of images from a folder to a new scanLink
fsdb_import_images /romi_db /path/to/folder_with_images
Import with custom scan name and verbose loggingLink
fsdb_import_images /romi_db /path/to/folder_with_images --name my_custom_scan --log-level INFO
list_image_files
Link
list_image_files(images_path)
List image files in the path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Path
|
The path to the folder containing the dataset. |
required |
Returns:
| Type | Description |
|---|---|
list
|
The list of image files, selected by their extensions. |
Source code in plantdb/commons/cli/fsdb_import_images.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 | |
main
Link
main(db_path, folder, name, metadata, user, password, no_auth, log_level)
FSDB Images Import CLI
A command‑line utility that imports the content of a folder as an 'images' Fileset to a new Scan dataset,
optionally attaching metadata and providing configurable logging.
DATABASE is the path to the local database where to create the scan dataset. FOLDER is the path to the folder containing the images to import.
Source code in plantdb/commons/cli/fsdb_import_images.py
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | |