Skip to main content

Type stubs for nibabel

Project description

nibabel-stubs

Type stubs for nibabel, a Python package for reading and writing neuroimaging file formats.

Installation

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:

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:
    mypy your_test_file.py
    

License

See 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nibabel_stubs-0.1.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nibabel_stubs-0.1.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file nibabel_stubs-0.1.0.tar.gz.

File metadata

  • Download URL: nibabel_stubs-0.1.0.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for nibabel_stubs-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a19ed78135328786313164a602527dc7a653b8357e4af11ec4d6c42dd1e9c2f7
MD5 5d5cc03f1a8477ca7415e5f5d3640ba9
BLAKE2b-256 ab0d65e2cce41dd61beea2c4b4514675f9435128abdc6d913c0eb148989b4947

See more details on using hashes here.

File details

Details for the file nibabel_stubs-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: nibabel_stubs-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for nibabel_stubs-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b58a8732d976de79b2c7aaf8ca009294ba5360fe9332ccff206f92b4c08b2a35
MD5 d8d2d752815d3a9b96d7e377a8abba1f
BLAKE2b-256 d9da606a220f74d000a714eb716fe484256a81b3e98040ddbf20d83634623b01

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page