Tabular file remodeling and reorganizing tools for event files and datasets.
Project description
The remodeler
Tabular file remodeling and reorganizing tools for event files and datasets.
Overview
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
Installation
pip install table-remodeler
For development:
git clone https://github.com/hed-standard/table-remodeler.git
cd table-remodeler
pip install -e .
Quick start
Python API
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()
Command line
# 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_backup
Available operations
Data Transformation
factor_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
HED-specific operations
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
Analysis operations
summarize_column_names- List column names across filessummarize_column_values- Summarize unique values per column
Documentation
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.
Building Documentation
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.
Requirements
- Python 3.10+
- pandas
- numpy
- hedtools (for HED-specific operations)
License
MIT License - see LICENSE file for details
Contributing
Contributions are welcome! Please see the development setup in the documentation.
Related Projects
- hed-python - Core HED tools
- hed-schemas - HED schema vocabularies
- hed-specification - HED specification
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file table_remodeler-0.2.0.tar.gz.
File metadata
- Download URL: table_remodeler-0.2.0.tar.gz
- Upload date:
- Size: 51.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e71c7bfd45c85b916685c564e6f430baa3755ecd38cbf313890fc83b4607ccd9
|
|
| MD5 |
5ae7fd515b556f65d126114f49e35e71
|
|
| BLAKE2b-256 |
6a21094871407afb04edc8336c75c13684c072023559a8071303286143835117
|
File details
Details for the file table_remodeler-0.2.0-py3-none-any.whl.
File metadata
- Download URL: table_remodeler-0.2.0-py3-none-any.whl
- Upload date:
- Size: 68.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a166964763d9df14b49072451e0f45941810dd2bcf376e92aeed0d3377aab591
|
|
| MD5 |
19344853f64c36c9fffa0bd8b895242a
|
|
| BLAKE2b-256 |
ce0fae1fa2df0c4da86943cbf4c42b3e62ad135624c5add9259c8811c71804b3
|