Metadata-Version: 2.4
Name: nibabel-stubs
Version: 0.1.0
Summary: Type stubs for nibabel
Author-email: Joshua Hoeflich <josh@nudge.com>
License: Copyright <2025> <Joshua Hoeflich>
        
        Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Project-URL: Homepage, https://github.com/joshnibabel/nibabel-stubs
Project-URL: Repository, https://github.com/joshnibabel/nibabel-stubs
Project-URL: Issues, https://github.com/joshnibabel/nibabel-stubs/issues
Keywords: nibabel,type stubs,typing,mypy
Classifier: Typing :: Typed
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE.md
Dynamic: license-file

# nibabel-stubs

Type stubs for [nibabel](https://nipy.org/nibabel/), a Python package for reading and writing neuroimaging file formats.

## Installation

```bash
pip install nibabel-stubs
```

## Usage

Once installed, type checkers like mypy, pyright, and IDEs like PyCharm and VS Code will automatically use these type stubs when you use nibabel in your code.

Example:

```python
import nibabel as nib

# Type checkers will now understand nibabel's API
img = nib.load("example.nii.gz")
data = img.get_fdata()
affine = img.affine
header = img.header
```

## What's Included

This package provides type hints for:

- `Nifti1Image` and `Nifti1Header` classes
- `load()` and `save()` functions
- `affines` module utilities
- `orientations` module utilities
- Common nibabel operations with proper numpy array typing

## Requirements

- Python >= 3.7
- numpy (for numpy.typing support)

## Development

To contribute or modify these stubs:

1. Clone the repository
2. Edit `nibabel-stubs/__init__.pyi`
3. Test with your type checker:
   ```bash
   mypy your_test_file.py
   ```

## License

See [LICENSE.md](LICENSE.md) for details.

## Compatibility

These stubs are designed to work with nibabel's public API. If you find any issues or missing definitions, please open an issue or submit a pull request.

