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
Metadata
Release files for nvidia-nvimgcodec-cu11-stubs 0.5.0.13.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nvidia_nvimgcodec_cu11_stubs-0.5.0.13.7-py3-none-any.whl | Python 3 | none | any | Details |
Release files / nvidia_nvimgcodec_cu11_stubs-0.5.0.13.7-py3-none-any.whl
| Download URL | nvidia_nvimgcodec_cu11_stubs-0.5.0.13.7-py3-none-any.whl |
|---|---|
| Size | 22.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
59f1565000d088cb5fe06060d1e86674e119f2530cda36f244094acac120c21a
|
|
BLAKE2b-256 checksum How to use checksums |
7aa9f4870e8b98578c166ec8af25d3fcdd5a1e7f2d3405eeeb9283022512145d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Security for nvidia-nvimgcodec-cu11-stubs 0.5.0.13.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.