11#!/usr/bin/env python3
22"""
3- HED Command Line Interface
3+ HED Command Line Interface.
44
55A unified command-line interface for HED (Hierarchical Event Descriptors) tools.
66Provides a git-like interface with subcommands for validation and schema management.
2222@click .group (context_settings = {"help_option_names" : ["-h" , "--help" ]})
2323@click .version_option (version = str (vr .get_versions ()["version" ]), prog_name = "hedpy" )
2424def cli ():
25- """HED (Hierarchical Event Descriptors) command-line tools
25+ """HED (Hierarchical Event Descriptors) command-line tools.
2626
2727 This tool provides various commands for working with HED annotations,
2828 including validation and schema management.
@@ -38,16 +38,16 @@ def cli():
3838def schema ():
3939 """HED schema management and validation tools
4040
41- Commands for validating, updating, and managing HED schemas
41+ Commands for validating, updating, and managing HED schemas.
4242 """
4343 pass
4444
4545
4646@cli .group ()
4747def validate ():
48- """HED validation tools
48+ """HED validation tools.
4949
50- Commands for validating HED annotations in datasets, files, and strings
50+ Commands for validating HED annotations in datasets, files, and strings.
5151 """
5252 pass
5353
@@ -203,7 +203,7 @@ def validate_bids_cmd(
203203):
204204 """Validate HED annotations in a BIDS dataset.
205205
206- DATA_PATH: Full path to the root directory of the BIDS dataset
206+ DATA_PATH: Full path to the root directory of the BIDS dataset.
207207 """
208208 from hed .scripts .validate_bids import main as validate_bids_main
209209
@@ -265,7 +265,7 @@ def schema_validate_cmd(schema_path, add_all_extensions, verbose):
265265
266266 \b
267267 Arguments:
268- SCHEMA_PATH: Path(s) to schema file(s) to validate
268+ SCHEMA_PATH: Path(s) to schema file(s) to validate.
269269 """
270270 from hed .scripts .validate_schemas import main as validate_schemas_main
271271
@@ -342,40 +342,6 @@ def schema_add_ids_cmd(repo_path, schema_name, schema_version):
342342 add_ids_main (args )
343343
344344
345- @schema .command (name = "create-ontology" )
346- @click .argument ("repo_path" , type = click .Path (exists = True ))
347- @click .argument ("schema_name" )
348- @click .argument ("schema_version" )
349- @click .option ("--dest" , type = click .Path (), help = "Output directory for ontology files" )
350- def schema_create_ontology_cmd (repo_path , schema_name , schema_version , dest ):
351- """Create an ontology from a HED schema.
352-
353- This command generates OWL ontology files from HED schema, enabling
354- integration with semantic web tools and ontology reasoners.
355-
356- \b
357- Examples:
358- # Create ontology from standard schema
359- hedpy schema create-ontology /path/to/hed-schemas standard 8.3.0
360-
361- # Create ontology with custom output directory
362- hedpy schema create-ontology /path/to/hed-schemas standard 8.3.0 --dest /output/path
363-
364- \b
365- Arguments:
366- REPO_PATH: Path to hed-schemas repository
367- SCHEMA_NAME: Schema name (e.g., 'standard')
368- SCHEMA_VERSION: Schema version (e.g., '8.3.0')
369- """
370- from hed .scripts .create_ontology import main as create_ontology_main
371-
372- args = [repo_path , schema_name , schema_version ]
373- if dest :
374- args .extend (["--dest" , dest ])
375-
376- create_ontology_main (args )
377-
378-
379345@cli .group ()
380346def extract ():
381347 """HED extraction and analysis tools.
@@ -422,7 +388,7 @@ def extract():
422388 default = "events" ,
423389 show_default = "events" ,
424390 metavar = METAVAR_NAME ,
425- help = "Suffix for base filename(s) (e.g., '-s events to match files ending with events .tsv" ,
391+ help = "Suffix for base filename(s) (e.g., '-s participants' to match files ending with participants .tsv" ,
426392)
427393@optgroup .option (
428394 "-x" ,
@@ -493,7 +459,7 @@ def extract_bids_sidecar_cmd(
493459):
494460 """Extract a sidecar template from a BIDS dataset.
495461
496- DATA_PATH: Root directory of the BIDS dataset
462+ DATA_PATH: Root directory of the BIDS dataset.
497463 """
498464 from hed .scripts .hed_extract_bids_sidecar import main as extract_main
499465
@@ -561,7 +527,7 @@ def extract_bids_sidecar_cmd(
561527 "--prefix" ,
562528 "name_prefix" ,
563529 metavar = METAVAR_PREFIX ,
564- help = "Prefix for base filename (e.g., -s sub- to match 'sub-01_events.tsv')" ,
530+ help = "Prefix for base filename (e.g., -p sub- to match 'sub-01_events.tsv')" ,
565531)
566532@optgroup .option (
567533 "-s" ,
@@ -674,7 +640,7 @@ def extract_tabular_summary_cmd(
674640):
675641 """Extract tabular summary from TSV files.
676642
677- DATA_PATH: Root directory containing TSV files to process
643+ DATA_PATH: Root directory containing TSV files to process.
678644 """
679645 from hed .scripts .extract_tabular_summary import main as extract_summary_main
680646
0 commit comments