mihcsme_py.cli#
mihcsme_py.cli
#
Command-line interface for mihcsme-omero.
This module requires optional CLI dependencies (typer, rich). Install with: pip install mihcsme-omero[cli]
app()
#
load_metadata(file_path: Path) -> MIHCSMEMetadata
#
Load metadata from either Excel (.xlsx) or JSON file.
:param file_path: Path to Excel or JSON file :return: Parsed MIHCSMEMetadata object
Source code in src/mihcsme_py/cli.py
main(version: Optional[bool] = typer.Option(None, '--version', '-v', help='Show version and exit', callback=version_callback, is_eager=True), verbose: bool = typer.Option(False, '--verbose', '-V', help='Enable verbose logging')) -> None
#
MIHCSME OMERO metadata management tool.
Source code in src/mihcsme_py/cli.py
parse(excel_file: Path = typer.Argument(..., help='Path to MIHCSME Excel file', exists=True, dir_okay=False, readable=True), output: Optional[Path] = typer.Option(None, '--output', '-o', help='Output JSON file (default: same name as input with .json extension)'), validate: bool = typer.Option(True, '--validate/--no-validate', help='Validate the Excel structure')) -> None
#
Parse MIHCSME Excel file and convert to JSON (via Pydantic model).
This validates the Excel structure and outputs a JSON representation of the metadata.
Source code in src/mihcsme_py/cli.py
to_excel(json_file: Path = typer.Argument(..., help='Path to MIHCSME JSON file', exists=True, dir_okay=False, readable=True), output: Optional[Path] = typer.Option(None, '--output', '-o', help='Output Excel file (default: same name as input with .xlsx extension)')) -> None
#
Convert MIHCSME JSON file to Excel format.
This creates an Excel file from a JSON metadata file, useful for editing or sharing the metadata in Excel format.
Source code in src/mihcsme_py/cli.py
upload(metadata_file: Path = typer.Argument(..., help='Path to MIHCSME Excel (.xlsx) or JSON (.json) file', exists=True, dir_okay=False, readable=True), screen_id: Optional[int] = typer.Option(None, '--screen-id', '-s', help='OMERO Screen ID'), plate_id: Optional[int] = typer.Option(None, '--plate-id', '-p', help='OMERO Plate ID'), host: str = typer.Option(..., '--host', '-H', help='OMERO host', envvar='OMERO_HOST'), user: str = typer.Option(..., '--user', '-u', help='OMERO username', envvar='OMERO_USER'), port: int = typer.Option(4064, '--port', help='OMERO port', envvar='OMERO_PORT'), group: Optional[str] = typer.Option(None, '--group', '-g', help='OMERO group', envvar='OMERO_GROUP'), namespace: str = typer.Option('MIHCSME', '--namespace', '-n', help='Base namespace for annotations'), replace: bool = typer.Option(False, '--replace', '-r', help='Replace existing metadata (remove old annotations first)')) -> None
#
Upload MIHCSME metadata from Excel or JSON to OMERO.
Accepts either Excel (.xlsx) or JSON (.json) files. You must specify either --screen-id or --plate-id as the target.
Source code in src/mihcsme_py/cli.py
223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 | |
validate(excel_file: Path = typer.Argument(..., help='Path to MIHCSME Excel file', exists=True, dir_okay=False, readable=True)) -> None
#
Validate MIHCSME Excel file structure.
Checks that all required sheets are present and properly formatted.