Metadata-Version: 2.4
Name: neuralib-utils
Version: 0.7.1
Summary: Utilities for neuralib
Author-email: Yu-Ting Wei <ytsimon2004@gmail.com>
License: BSD 3-Clause License
        
        Copyright (c) 2023, YT.WEI
        
        Redistribution and use in source and binary forms, with or without
        modification, are permitted provided that the following conditions are met:
        
        1. Redistributions of source code must retain the above copyright notice, this
           list of conditions and the following disclaimer.
        
        2. Redistributions in binary form must reproduce the above copyright notice,
           this list of conditions and the following disclaimer in the documentation
           and/or other materials provided with the distribution.
        
        3. Neither the name of the copyright holder nor the names of its
           contributors may be used to endorse or promote products derived from
           this software without specific prior written permission.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
        AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
        DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
        FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
        SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
        CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
        OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
        OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Project-URL: Homepage, https://github.com/ytsimon2004/neuralib2
Project-URL: Documentation, https://neuralib2.readthedocs.io/en/latest/index.html
Project-URL: Repository, https://github.com/ytsimon2004/neuralib2
Project-URL: Issues, https://github.com/ytsimon2004/neuralib2/issues
Keywords: Utilies
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: BSD License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Topic :: Scientific/Engineering
Classifier: Intended Audience :: Science/Research
Classifier: Typing :: Typed
Requires-Python: <3.13,>=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: attrs>=25.3.0
Requires-Dist: numpy>=2.0
Requires-Dist: scipy
Requires-Dist: pandas
Requires-Dist: polars
Requires-Dist: pyarrow
Requires-Dist: h5py
Requires-Dist: rich
Requires-Dist: tqdm
Requires-Dist: typing_extensions
Requires-Dist: gdown
Provides-Extra: dashboard
Requires-Dist: bokeh; extra == "dashboard"
Provides-Extra: plot
Requires-Dist: seaborn>=0.13.2; extra == "plot"
Requires-Dist: matplotlib_venn>=1.1.2; extra == "plot"
Requires-Dist: matplotlib>=3.10.3; extra == "plot"
Provides-Extra: opt
Requires-Dist: colorama>=0.4.6; extra == "opt"
Requires-Dist: colorlog; extra == "opt"
Requires-Dist: gspread; extra == "opt"
Requires-Dist: slackclient; extra == "opt"
Requires-Dist: psutil; extra == "opt"
Requires-Dist: opencv-python; extra == "opt"
Requires-Dist: scikit-image; extra == "opt"
Requires-Dist: tiffile; extra == "opt"
Provides-Extra: all
Requires-Dist: neuralib-utils[plot]; extra == "all"
Requires-Dist: neuralib-utils[opt]; extra == "all"
Provides-Extra: test
Requires-Dist: neuralib-utils[dashboard]; extra == "test"
Requires-Dist: neuralib-utils[all]; extra == "test"
Dynamic: license-file

# neuralib-utils

Core utilities and foundational tools for the neuralib ecosystem, providing I/O operations, data manipulation, type
definitions, visualization helpers, and common infrastructure for neuroscience research workflows.

## Overview

`neuralib-utils` is the foundational package for neuralib, providing essential utilities that other neuralib packages
depend on. It includes:

- **File I/O**: Efficient HDF5 lazy loading, JSON/CSV handling, dataset management
- **Type System**: Unified type aliases supporting both pandas and polars DataFrames
- **Utilities**: Logging, colored output, DataFrame operations, GPU monitoring, profiling
- **Plotting**: Publication-quality plotting tools (PSTH, Venn diagrams, colormaps)
- **Dashboard**: Bokeh-based web UI framework for interactive data visualization
- **Image Utilities**: Array manipulation, labeling, color management, normalization
- **External Tools**: Google Sheets and Slack integrations

This package serves as the core dependency for all other neuralib packages (`neuralib-atlas`, `neuralib-imaging`, etc.).

## Installation

### From PyPI

```bash
pip install neuralib-utils
```

### With Optional Dependencies

```bash
# Dashboard support (Bokeh)
pip install neuralib-utils[dashboard]

# Plotting support (matplotlib, seaborn)
pip install neuralib-utils[plot]

# Optional tools (Google Sheets, Slack, GPU monitoring)
pip install neuralib-utils[opt]

# All features
pip install neuralib-utils[all]
```

### From Source (uv recommended)

```bash
git clone https://github.com/ytsimon2004/neuralib2.git
cd neuralib2/packages/neuralib-utils
uv pip install -e .        # Basic installation
uv pip install -e ".[all]" # With all features
```

### Requirements

- Python 3.11 or 3.12
- Core dependencies: `numpy`, `scipy`, `pandas`, `polars`, `h5py`, `rich`, `tqdm`
- See `pyproject.toml` for full dependency list

## Documentation

- **Main Documentation**: [https://neuralib2.readthedocs.io/](https://neuralib2.readthedocs.io/en/latest/index.html)
- **GitHub Repository**: [https://github.com/ytsimon2004/neuralib2](https://github.com/ytsimon2004/neuralib2)
- **Issue Tracker**: [https://github.com/ytsimon2004/neuralib2/issues](https://github.com/ytsimon2004/neuralib2/issues)

## Related Packages

`neuralib-utils` is the foundation for the neuralib ecosystem:

- `neuralib-atlas`: Brain atlas tools and hierarchical representations of mouse brain anatomy
- `neuralib-imaging`: Cellular imaging and widefield imaging tools
- `neuralib-parser`: Data parsers for segmentation, morphology, Suite2p, Scanbox, CZI, StarDist
- `neuralib-metric`: Analysis metrics and computational tools

## License

BSD 3-Clause License. See LICENSE file for details.

## Contributing

Contributions are welcome! Please:

1. Fork the repository
2. Create a feature branch
3. Submit a pull request with clear description

For bug reports and feature requests, use the [GitHub issue tracker](https://github.com/ytsimon2004/neuralib2/issues).

