Tabular file remodeling and reorganizing tools for event files and datasets.
remodeler provides a flexible, operation-based framework for transforming tabular data files through JSON-configurable pipelines. Originally extracted from the hed-python remodeling tools, this package operates as a standalone tool while maintaining compatibility with HED (Hierarchical Event Descriptors) annotations via the hedtools dependency.
Key features:
- Operation-based architecture for reproducible data transformations
- JSON-configurable pipelines for batch processing
- Support for HED-annotated event files (via
hedtoolspackage) - Built-in backup and restore functionality
- Both programmatic API and command-line interface
- Extensible: create custom operations by extending
BaseOp
pip install remodelerFor development:
git clone https://github.com/hed-standard/table-remodeler.git
cd table-remodeler
pip install -e .from remodeler import Dispatcher
# Define operations
operations = [
{
"operation": "remove_columns",
"parameters": {"column_names": ["unnecessary_col"]}
},
{
"operation": "rename_columns",
"parameters": {"column_mapping": {"old_name": "new_name"}}
}
]
# Execute operations
dispatcher = Dispatcher(operations, data_root="/path/to/dataset")
dispatcher.run_operations()# Run remodeling operations
run_remodel /path/to/data /path/to/operations.json
# Create backup before modifications
run_remodel_backup /path/to/data --backup-name my_backup
# Restore from backup
run_remodel_restore /path/to/data --backup-name my_backupfactor_column- Create factor columns from value mappingsmerge_consecutive- Merge consecutive rows with same valuesremap_columns- Remap column values using lookup tablesremove_columns- Remove specified columnsremove_rows- Remove rows based on criteriarename_columns- Rename columnsreorder_columns- Reorder columnssplit_rows- Split rows based on criteria
factor_hed_tags- Factor HED tags into separate columnsfactor_hed_type- Factor by HED tag typessummarize_hed_tags- Summarize HED tag usagesummarize_hed_type- Summarize HED typessummarize_hed_validation- Validate HED annotationssummarize_definitions- Extract HED definitionssummarize_sidecar_from_events- Generate sidecar from events
summarize_column_names- List column names across filessummarize_column_values- Summarize unique values per column
Full API and developer documentation is available at https://www.hedtags.org/table-remodeler.
Users of the table-remodeler should look at the HED remodeling quickstart and HED remodeling tools.
To build the documentation locally:
-
Install documentation dependencies:
pip install -r docs/requirements.txt
-
Build the HTML documentation:
sphinx-build -b html docs docs/_build/html
-
View the documentation by opening
docs/_build/html/index.htmlin your web browser.
- Python 3.10+
- pandas
- numpy
- hedtools (for HED-specific operations)
MIT License - see LICENSE file for details
Contributions are welcome! Please see the development setup in the documentation.
- hed-python - Core HED tools
- hed-schemas - HED schema vocabularies
- hed-specification - HED specification