Skip to main content

PyPI - Status Python3 Maintainability Code Coverage Docs

HED visualization

hedvis provides word cloud generation and visual summaries for HED-annotated data, making it easy to explore and present the semantic content of your experimental datasets.

Features

  • Word Cloud Generation - Create beautiful word clouds from HED tag frequencies
  • Flexible Configuration - Extensive customization options for visualizations
  • Shaped Clouds - Support for mask images to create custom-shaped word clouds
  • Multiple Formats - Export to PNG and SVG formats
  • hedtools Integration - Seamless integration with the HED Python tools ecosystem
  • Two APIs - A modern configuration-based API (VisualizationConfig) and a simple legacy API for quick tasks

Installation

From PyPI (recommended)

Install the latest stable release:

pip install hedvis

This automatically installs hedtools and all required dependencies.

Development installation

For development work, clone the repository and install in editable mode:

git clone https://github.com/hed-standard/hed-vis.git
cd hed-vis
pip install -e .

Installing optional dependencies

The project uses pyproject.toml as the single source of truth for all dependencies. Install optional dependencies using pip extras.

Important: Installing with extras automatically includes all base dependencies (hedtools, numpy, pandas, etc.) plus the extra tools.

Development tools (code formatting, linting, testing):

# From PyPI (if you installed hedvis from PyPI)
pip install "hedvis[dev]"

# From local source (if you cloned the repository)
pip install ".[dev]"          # Regular install
pip install -e ".[dev]"       # Editable install (recommended for development)

Documentation tools (Sphinx, themes):

# From PyPI
pip install "hedvis[docs]"

# From local source
pip install ".[docs]"

Both dev and docs dependencies:

# From PyPI
pip install "hedvis[dev,docs]"

# From local source
pip install ".[dev,docs]"

Installing from source without extras

To install from source with only the core dependencies:

git clone https://github.com/hed-standard/hed-vis.git
cd hed-vis
pip install .

If you need to install dependencies for development or documentation:

  • Use pip install ".[dev]" instead of pip install -r requirements-dev.txt
  • Use pip install ".[docs]" instead of pip install -r docs/requirements.txt
  • Core dependencies are installed automatically with pip install . or pip install hedvis

Quick start

Simple word cloud

from hedvis import create_wordcloud

# Create word cloud from frequency dictionary
word_freq = {
    "Event": 15,
    "Action": 10,
    "Sensory-event": 8,
    "Visual-presentation": 7
}

wc = create_wordcloud(word_freq, width=800, height=600)
wc.to_file("wordcloud.png")

Using the hedvis API

from hedvis import HedTagVisualizer, WordCloudConfig, VisualizationConfig

# Configure visualization
wc_config = WordCloudConfig(
    width=1200,
    height=800,
    background_color="white",
    colormap="viridis"
)

viz_config = VisualizationConfig(
    word_cloud=wc_config,
    output_formats=["png", "svg"]
)

# Create visualizer
visualizer = HedTagVisualizer(viz_config)

# Generate from HED tag counts (from hedtools)
results = visualizer.visualize_from_counts(tag_counts)

Integration with hedtools

from hed import load_schema
from hed.models import TabularInput
from hedvis import HedTagVisualizer

# Load HED schema and data
schema = load_schema()
tabular = TabularInput("events.tsv", sidecar="events.json")

# Create visualizer
visualizer = HedTagVisualizer()

# Generate visualizations
results = visualizer.visualize_from_tabular(
    tabular,
    schema,
    output_basename="experiment_tags"
)

# Save word cloud
results['word_cloud']['wordcloud_object'].to_file("tags.png")

All dependencies are managed in pyproject.toml and installed automatically with pip install hedvis.

For the complete list of dependencies with exact versions, see the dependencies section in pyproject.toml.

Development setup

Prerequisites

  • Python 3.10 or higher
  • Git
  • pip (Python package manager)

Setting up your development environment

  1. Fork and clone the repository:

    git clone https://github.com/YOUR_USERNAME/hed-vis.git
    cd hed-vis
    
  2. Create a virtual environment (recommended):

    python -m venv .venv
    .venv\Scripts\activate  # On Windows PowerShell
    source .venv/bin/activate  # On Unix/MacOS
    
  3. Install in development mode:

    All dependencies are managed in pyproject.toml. Install the package with development tools:

    pip install -e ".[dev]"
    

    This installs:

    • The hedvis package in editable mode
    • All required dependencies (hedtools, wordcloud, matplotlib, etc.)
    • Development tools (black, ruff, codespell, mdformat)
    • Testing tools (coverage)

    To install additional optional dependencies:

    # Documentation tools
    pip install -e ".[docs]"
    
    # Both dev and docs
    pip install -e ".[dev,docs]"
    

    Note: Do not use legacy requirements files (requirements.txt, requirements-dev.txt). All dependencies are defined in pyproject.toml.

  4. Run tests to verify setup:

    python -m unittest discover tests
    

Related projects

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

Support

License

This project is licensed under the MIT License - see LICENSE for details.

Citation

If you use hedvis in your research, please cite:

If you use HEDTools in your research, please cite:

@software{hedtools,
  author = {Ian Callanan, Robbins, Kay and others},
  title = {HEDVis: Visualization tools for HED},
  year = {2024},
  publisher = {GitHub},
  url = {https://github.com/hed-standard/hed-vis},
}

Release files for hedvis 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hedvis 0.1.1
File Size Uploaded
hedvis-0.1.1.tar.gz 25.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hedvis 0.1.1
File Interpreter ABI Platform
hedvis-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 42.2 kB

Release files / hedvis-0.1.1.tar.gz

Download URL hedvis-0.1.1.tar.gz
Size 25.3 kB
Tags Source
SHA-256 checksum
How to use checksums
069d39d77fa217a8afd7ebd576b6f4b8d00a25b7e6d00f379906f5dac0c30940
BLAKE2b-256 checksum
How to use checksums
14098f9c97c8f0a918000ac2ee08cc9f6671b0339bdf8587257e70afa04d3c81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.4

Release files / hedvis-0.1.1-py3-none-any.whl

Download URL hedvis-0.1.1-py3-none-any.whl
Size 16.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
92484977f11ec7e78fe931bda9e23528fc84aeca5e1f66c4d1b93694dbf5db6e
BLAKE2b-256 checksum
How to use checksums
9a29e5b81da4afd386c83734e7377ce643e51854558e91a1a208f3cde5043d9d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.4

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page