fsdb_import_folder
FSDB Folder Import CLILink
A command‑line utility that imports a folder's contents as a Fileset in a known Scan dataset, optionally
attaching metadata and providing configurable logging.
It streamlines adding new data to a PlantDB database directly from the terminal.
Key FeaturesLink
- Simple CLI interface using
clickwith positional arguments for the target scan and source folder. - 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 a folder into an existing scanLink
fsdb_import_folder /romi_db/scan001 /path/to/folder_with_files
Import with metadata and verbose loggingLink
fsdb_import_folder /romi_db/scan001 /path/to/folder_with_files --metadata /path/to/folder_meta.json --log-level INFO
main
Link
main(scan_path, folder, metadata, user, password, no_auth, log_level)
FSDB Folder Import CLI
A command‑line utility that imports a folder's contents as a Fileset in a known Scan dataset, optionally
attaching metadata and providing configurable logging.
SCAN is the path to the scan that will receive the imported fileset. FOLDER is the path to the source folder containing files to import.
Source code in plantdb/commons/cli/fsdb_import_folder.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 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 | |