Metadata-Version: 2.4
Name: nvidia-nvimgcodec-cu12-stubs
Version: 0.5.0.13.5
Summary: Type stubs for NVIDIA NVIMGCODEC CUDA 12 bindings
Project-URL: Homepage, https://github.com/sync-dev-org/nvidia-nvimgcodec-cu12-stubs
Author-email: minamik <mia@sync.dev>
License: MIT License
        
        Copyright (c) 2025 minamik
        
        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.
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Stubs Only
Requires-Python: >=3.10
Requires-Dist: nvidia-nvimgcodec-cu12[all]==0.5.0.13
Provides-Extra: dev
Requires-Dist: black>=23.7.0; extra == 'dev'
Requires-Dist: flake8>=6.1.0; extra == 'dev'
Requires-Dist: pybind11-stubgen>=2.5.4; extra == 'dev'
Requires-Dist: pytest>=8.3.5; extra == 'dev'
Requires-Dist: twine>=6.1.0; extra == 'dev'
Description-Content-Type: text/markdown

# 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 library
  - `nvidia.nvimgcodec` - Image encoding/decoding library
  - `nvidia.nvjpeg` - JPEG processing library
  - `nvidia.nvjpeg2k` - JPEG 2000 processing library
  - `nvidia.nvtiff` - TIFF processing library

## Installation

### CUDA 12 version
```bash
pip install nvidia-nvimgcodec-cu12-stubs
```

### CUDA 11 version
```bash
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:

```python
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:

```bash
# uv will be automatically installed if not present
./build.sh
```

### Build Process

The `build.sh` script automatically performs the following:

1. Generates stubs for both CUDA 11 and CUDA 12 versions
2. Creates project configuration from template files
3. Auto-generates type stubs using `pybind11-stubgen`
4. Builds the packages

### Manual Stub Generation

```bash
# 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

- [NVIDIA nvimgcodec](https://github.com/NVIDIA/nvImageCodec)
- [GitHub Repository](https://github.com/sync-dev-org/nvidia-nvimgcodec-stubs)