Type stubs for NVIDIA NVIMGCODEC CUDA 12 bindings
Project description
nvidia-nvimgcodec-stubs
Type stubs for NVIDIA nvimgcodec Python API.
Description
This project provides type stubs for the NVIDIA nvimgcodec Python API. It enables static type checking and IDE autocompletion for nvimgcodec in Python projects.
Features
- Support for both CUDA 11 and CUDA 12
- Includes type stubs for the following NVIDIA libraries:
nvidia.nvcomp- Data compression librarynvidia.nvimgcodec- Image encoding/decoding librarynvidia.nvjpeg- JPEG processing librarynvidia.nvjpeg2k- JPEG 2000 processing librarynvidia.nvtiff- TIFF processing library
Installation
CUDA 12 version
pip install nvidia-nvimgcodec-cu12-stubs
CUDA 11 version
pip install nvidia-nvimgcodec-cu11-stubs
Usage
After installation, your IDE and type checkers (like mypy, pyright, etc.) will automatically use these stubs when you import nvimgcodec:
import nvidia.nvimgcodec as nvimgcodec
# Your IDE will now provide autocompletion and type checking for nvimgcodec
decoder = nvimgcodec.Decoder()
Requirements
- Python >= 3.10
- nvidia-nvimgcodec-cu12[all] == 0.5.0.13 (for CUDA 12 version)
- nvidia-nvimgcodec-cu11[all] == 0.5.0.13 (for CUDA 11 version)
Development
Build Environment Setup
This project uses uv for building:
# uv will be automatically installed if not present
./build.sh
Build Process
The build.sh script automatically performs the following:
- Generates stubs for both CUDA 11 and CUDA 12 versions
- Creates project configuration from template files
- Auto-generates type stubs using
pybind11-stubgen - Builds the packages
Manual Stub Generation
# Create and activate virtual environment
uv python pin 3.12
uv sync --extra dev
source .venv/bin/activate # Linux/macOS
# or .venv\Scripts\activate # Windows
# Generate stubs
python -m pybind11_stubgen nvidia --ignore-all-errors --output-dir src
python -m pybind11_stubgen nvidia.nvcomp --ignore-all-errors --output-dir src
python -m pybind11_stubgen nvidia.nvimgcodec --ignore-all-errors --output-dir src
python -m pybind11_stubgen nvidia.nvjpeg --ignore-all-errors --output-dir src
python -m pybind11_stubgen nvidia.nvjpeg2k --ignore-all-errors --output-dir src
python -m pybind11_stubgen nvidia.nvtiff --ignore-all-errors --output-dir src
# Build package
uv build
License
MIT
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Related Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nvidia_nvimgcodec_cu11_stubs-0.5.0.13.4-py3-none-any.whl.
File metadata
- Download URL: nvidia_nvimgcodec_cu11_stubs-0.5.0.13.4-py3-none-any.whl
- Upload date:
- Size: 22.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7eaac1745a1048b4f30eda01bf2172139e2d5c08eb5d7972a9eb8d7cd1c55045
|
|
| MD5 |
b6ede7978e2b801c53036fdaa76aa8c3
|
|
| BLAKE2b-256 |
fae74db14ddef25a3745794484f0ca493013d7831ccaa2786daaf0f82f414801
|