fsdb_import_file
FSDB File Import CLILink
A command‑line utility that imports a single file into a specified PlantDB fileset, 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 fileset and source file. - Optional metadata: load a JSON file and associate its contents with the imported file.
- Configurable logging: choose from predefined log levels to control output verbosity.
- Automatic database handling: connects to the FSDB, creates the necessary scan/fileset/file hierarchy, imports the file, applies metadata, and cleanly disconnects.
Usage ExamplesLink
Basic import of a file into an existing filesetLink
fsdb_import_file /romi_db/scan001/filesetA /path/to/image_01.png
Import with metadata and verbose loggingLink
fsdb_import_file /romi_db/scan001/filesetA /path/to/image_01.png --metadata /path/to/image_01_meta.json --log-level INFO
main
Link
main(fileset_path, file_path, metadata, user, password, no_auth, log_level)
FSDB File Import CLI
A command‑line utility that imports a single file into a specified PlantDB fileset, optionally attaching metadata and providing configurable logging.
FILESET is the path to the fileset that will receive the imported file. FILE is the path to the source file you want to import.
Source code in plantdb/commons/cli/fsdb_import_file.py
53 54 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 | |