---
description: Python via Java project guidance
globs: "**/*.py"
alwaysApply: false
---

# Aspose.Slides for Python via Java

Use these instructions for this platform only. Read the project's existing instructions and dependency files first. Keep its current package version unless the task requires a change. Confirm API names against this platform's documentation; bindings are not interchangeable.

## Setup

Use an isolated Python environment, `aspose-slides-java`, JPype, and a matching Java runtime. Set `JAVA_HOME` to the intended JDK so JPype does not select an older installed runtime. Import `asposeslides` before starting the JVM; import API types from `asposeslides.api` after it starts. Dispose presentations before shutting down the JVM. Treat JVM startup and shutdown as process-wide operations; do not copy the Python via .NET API.

## Install for a local test

With an isolated Python environment active, install the verified versions:

```sh
python -m pip install aspose-slides-java==26.6.0 JPype1==1.7.1
```

These pinned versions reproduce the example below. Preserve an existing project's dependency choices unless the user asks to change them.

## Minimal example

After installation, run this as `starter.py` in your configured project. It creates `hello.pptx` in the working directory. Use a scratch directory so an existing file is not replaced.

```python
import jpype
import asposeslides

jpype.startJVM()
try:
    from asposeslides.api import Presentation, SaveFormat, ShapeType

    presentation = Presentation()
    try:
        shape = presentation.getSlides().get_Item(0).getShapes().addAutoShape(
            ShapeType.Rectangle, 50, 50, 500, 80
        )
        shape.getTextFrame().setText("Hello, Aspose.Slides!")
        presentation.save("hello.pptx", SaveFormat.Pptx)
    finally:
        presentation.dispose()
finally:
    jpype.shutdownJVM()
```

Verified on 2026-11-18: Windows x64, Python 3.12, JDK 21, aspose-slides-java 26.6.0, JPype1 1.7.1. The program ran and the saved file contained one slide with the expected text. This evaluation-mode check does not prove licensed output or other operating systems.

## License

Evaluation mode is suitable for a local smoke test and can add watermarks or other limits. If the user supplies a valid license, follow the [licensing guide](https://docs.aspose.com/slides/python-java/licensing/) before creating presentations. Read the license from a private local location accessible to the process. Never put license contents, keys, or personal paths in instructions, source control, or logs.

## Verify the change

Before expanding a change, create a small presentation, save it to a new file, and open the result. Check the requested content, slide count, and formatting. Build and run the exact code against the installed package; report any missing runtime or dependency instead of claiming it was tested.

Keep input files local unless the user permits sharing them. Write output to a new file and preserve the original. Report what ran, the versions used, and any checks that remain.

## Sources

- [Documentation](https://docs.aspose.com/slides/python-java/)
- [API reference](https://reference.aspose.com/slides/python-java/)
- [Installation](https://docs.aspose.com/slides/python-java/installation/)
- [Licensing](https://docs.aspose.com/slides/python-java/licensing/)
