API Reference Overview

The HED Web Tools API provides a comprehensive set of modules for processing Hierarchical Event Descriptor (HED) data through web interfaces and programmatic access. The API is designed around a service-oriented architecture with clear separation of concerns.

Architecture Overview

Web Interface ──┐
                ├─► Flask Routes ──┬─► StringOperations
Client ─► REST API ──┘              ├─► EventOperations
                                    ├─► SchemaOperations
                                    ├─► SidecarOperations
                                    └─► SpreadsheetOperations

Module Structure

1. Application Layer

  • App Factory - Flask application configuration and initialization

  • Routes - Web interface endpoints and HTTP request handling

2. Service Layer

3. Operation Modules

4. Utility Modules

  • Columns - Column mapping and data structure utilities

  • Web Utils - Common web application helper functions


Service Categories

HED Schema Services

Handle HED schema files and validation:

  • Schema validation and compliance checking

  • Format conversion (XML ↔ MediaWiki)

  • Schema comparison and analysis

  • Version management

HED String Services

Process individual HED annotation strings:

  • Syntax validation and error reporting

  • Format conversion (short ↔ long form)

  • String assembly and validation

  • Placeholder resolution

HED Event Services

Work with event data files:

  • Event file validation against HED schemas

  • HED annotation assembly from spreadsheets

  • Event file format conversion

  • Batch processing capabilities

HED Sidecar Services

Handle BIDS-compliant sidecar files:

  • JSON sidecar validation

  • HED annotation extraction and validation

  • Sidecar format conversion

  • Integration with BIDS datasets

HED Spreadsheet Services

Process tabular data with HED annotations:

  • Excel and CSV file processing

  • Column mapping and validation

  • HED string assembly from columns

  • Data export and format conversion


Getting Started

Tip

New to the API? Start with the Getting Started Guide for a quick introduction.

Quick Example

from hedweb import create_app
from hedweb.string_operations import StringOperations

# Initialize the application
app = create_app()

# Create string operations service
string_ops = StringOperations()

# Validate a HED string
result = string_ops.process_string_data({
    'hed_string': 'Sensory-event, Visual-presentation',
    'schema_version': '8.2.0',
    'command': 'validate'
})

print(result['data'])  # Validation results

API Reference

External References