qt-lottie


Nameqt-lottie JSON
Version 0.1.1 PyPI version JSON
download
home_pageNone
SummaryCross-platform Python library providing Lottie animation support for Qt applications
upload_time2025-07-25 11:31:06
maintainerQt Lottie Contributors
docs_urlNone
authorQt Lottie Contributors
requires_python>=3.8
licenseMIT License
keywords qt lottie animation qml pyside6 pyqt6 graphics
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Qt Lottie

[![PyPI version](https://badge.fury.io/py/qt-lottie.svg)](https://badge.fury.io/py/qt-lottie)
[![Python versions](https://img.shields.io/pypi/pyversions/qt-lottie.svg)](https://pypi.org/project/qt-lottie/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Cross-platform Python library providing Lottie animation support for Qt applications, compatible with both PySide6 and PyQt6.

## Features

- **QML Component**: Feature-rich `LottieAnimation` component for QML applications
- **Python API**: Programmatic control of animations from Python
- **Cross-binding compatibility**: Works with both PySide6 and PyQt6
- **Performance optimized**: Uses RLottie backend with Qt-style caching
- **Zero-configuration**: Simple pip installation

## Installation

```bash
# Auto-detect Qt binding
pip install qt-lottie

# With specific Qt binding
pip install qt-lottie[pyside6]
pip install qt-lottie[pyqt6]
```

## Quick Start

### QML Usage

```qml
import QtQuick 2.15
import QtQuick.Window 2.15
import QtLottie 1.0

Window {
    width: 640
    height: 480
    visible: true
    
    LottieAnimation {
        anchors.centerIn: parent
        width: 200
        height: 200
        source: "path/to/animation.json"
        autoPlay: true
        loops: -1  // Infinite loops
        
        onFinished: console.log("Animation finished")
    }
}
```

### Python Usage

```python
import sys
from PySide6.QtWidgets import QApplication
from PySide6.QtQml import QQmlApplicationEngine
import qtlottie

# Initialize QML types
qtlottie.init_qml()

app = QApplication(sys.argv)
engine = QQmlApplicationEngine()

# Load QML that uses LottieAnimation
engine.load("main.qml")

sys.exit(app.exec())
```

## API Reference

### LottieAnimation Properties

#### Source & Loading
- `source: url` - Animation file path/URL
- `status: int` - Loading status (Null, Loading, Ready, Error)
- `asynchronous: bool` - Async loading (default: true)
- `cacheMode: int` - CacheNone, CacheLoop, CacheAll (default: CacheNone)

#### Playback Control
- `playing: bool` - Play state (default: false)
- `autoPlay: bool` - Auto-start (default: false)
- `playbackRate: real` - Speed multiplier (default: 1.0)
- `loops: int` - Loop count (-1 = infinite)
- `direction: int` - Forward, Reverse, Alternate

#### Timing & Position
- `position: real` - Current time in seconds
- `duration: real` - Total duration (read-only)
- `progress: real` - Progress 0.0-1.0 (read-only)
- `currentFrame: int` - Current frame (read-only)

#### Visual Properties
- `tintColor: color` - Color overlay
- `fillMode: int` - Stretch, PreserveAspectFit, PreserveAspectCrop
- `smooth: bool` - Antialiasing (default: true)

### Methods

- `play()` - Start animation
- `pause()` - Pause animation
- `stop()` - Stop and reset animation
- `toggle()` - Toggle play/pause
- `seek(position)` - Seek to time position
- `seekToFrame(frame)` - Seek to frame number
- `seekToMarker(name)` - Seek to named marker

### Signals

- `started()` - Animation started
- `stopped()` - Animation stopped
- `finished()` - Animation finished
- `positionChanged(real)` - Position changed
- `frameChanged(int)` - Frame changed
- `markerReached(string)` - Marker reached
- `error(string)` - Error occurred

## Performance

The library is designed for optimal performance with Qt-style size-based frame caching.

### Cache Modes

- `CacheNone`: Render frames on demand (default, lowest memory)
- `CacheLoop`: Cache one complete animation loop
- `CacheAll`: Cache entire animation (best performance for small animations)

## Requirements

- Python 3.8+
- PySide6 or PyQt6  
- rlottie-python
- Pillow (for image processing)

## License

MIT License - see LICENSE file for details.

## Development

### Setup
```bash
# Clone repository
git clone https://gitlab.com/acemetrics-oss/qt-lottie.git
cd qt-lottie

# Install in development mode
pip install -e ".[dev,pyside6,pyqt6]"
```

### Building
```bash
# Build package
python -m build

# Install from wheel
pip install dist/*.whl

# Test basic functionality
python -c "import qtlottie; print('✓ Import successful')"
```

### Testing
```bash
# Test examples
cd examples/pyside6
python main.py

cd ../pyqt6  
python main.py
```

## Contributing

Contributions welcome! Please see our [GitLab repository](https://gitlab.com/acemetrics-oss/qt-lottie) for guidelines.

## Links

- **PyPI**: https://pypi.org/project/qt-lottie/
- **Source Code**: https://gitlab.com/acemetrics-oss/qt-lottie
- **Issues**: https://gitlab.com/acemetrics-oss/qt-lottie/-/issues
- **Examples**: See examples/ directory in the repository

## Support

- **Issues**: Report bugs and request features on [GitLab Issues](https://gitlab.com/acemetrics-oss/qt-lottie/-/issues)
- **Documentation**: Full API reference available in the repository
- **Examples**: Working examples for both PySide6 and PyQt6 included

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "qt-lottie",
    "maintainer": "Qt Lottie Contributors",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "qt, lottie, animation, qml, pyside6, pyqt6, graphics",
    "author": "Qt Lottie Contributors",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/9b/38/c75d263c41e38d001f75d61dc9e3962924473f39eeec2be7b293fa456b65/qt_lottie-0.1.1.tar.gz",
    "platform": null,
    "description": "# Qt Lottie\n\n[![PyPI version](https://badge.fury.io/py/qt-lottie.svg)](https://badge.fury.io/py/qt-lottie)\n[![Python versions](https://img.shields.io/pypi/pyversions/qt-lottie.svg)](https://pypi.org/project/qt-lottie/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nCross-platform Python library providing Lottie animation support for Qt applications, compatible with both PySide6 and PyQt6.\n\n## Features\n\n- **QML Component**: Feature-rich `LottieAnimation` component for QML applications\n- **Python API**: Programmatic control of animations from Python\n- **Cross-binding compatibility**: Works with both PySide6 and PyQt6\n- **Performance optimized**: Uses RLottie backend with Qt-style caching\n- **Zero-configuration**: Simple pip installation\n\n## Installation\n\n```bash\n# Auto-detect Qt binding\npip install qt-lottie\n\n# With specific Qt binding\npip install qt-lottie[pyside6]\npip install qt-lottie[pyqt6]\n```\n\n## Quick Start\n\n### QML Usage\n\n```qml\nimport QtQuick 2.15\nimport QtQuick.Window 2.15\nimport QtLottie 1.0\n\nWindow {\n    width: 640\n    height: 480\n    visible: true\n    \n    LottieAnimation {\n        anchors.centerIn: parent\n        width: 200\n        height: 200\n        source: \"path/to/animation.json\"\n        autoPlay: true\n        loops: -1  // Infinite loops\n        \n        onFinished: console.log(\"Animation finished\")\n    }\n}\n```\n\n### Python Usage\n\n```python\nimport sys\nfrom PySide6.QtWidgets import QApplication\nfrom PySide6.QtQml import QQmlApplicationEngine\nimport qtlottie\n\n# Initialize QML types\nqtlottie.init_qml()\n\napp = QApplication(sys.argv)\nengine = QQmlApplicationEngine()\n\n# Load QML that uses LottieAnimation\nengine.load(\"main.qml\")\n\nsys.exit(app.exec())\n```\n\n## API Reference\n\n### LottieAnimation Properties\n\n#### Source & Loading\n- `source: url` - Animation file path/URL\n- `status: int` - Loading status (Null, Loading, Ready, Error)\n- `asynchronous: bool` - Async loading (default: true)\n- `cacheMode: int` - CacheNone, CacheLoop, CacheAll (default: CacheNone)\n\n#### Playback Control\n- `playing: bool` - Play state (default: false)\n- `autoPlay: bool` - Auto-start (default: false)\n- `playbackRate: real` - Speed multiplier (default: 1.0)\n- `loops: int` - Loop count (-1 = infinite)\n- `direction: int` - Forward, Reverse, Alternate\n\n#### Timing & Position\n- `position: real` - Current time in seconds\n- `duration: real` - Total duration (read-only)\n- `progress: real` - Progress 0.0-1.0 (read-only)\n- `currentFrame: int` - Current frame (read-only)\n\n#### Visual Properties\n- `tintColor: color` - Color overlay\n- `fillMode: int` - Stretch, PreserveAspectFit, PreserveAspectCrop\n- `smooth: bool` - Antialiasing (default: true)\n\n### Methods\n\n- `play()` - Start animation\n- `pause()` - Pause animation\n- `stop()` - Stop and reset animation\n- `toggle()` - Toggle play/pause\n- `seek(position)` - Seek to time position\n- `seekToFrame(frame)` - Seek to frame number\n- `seekToMarker(name)` - Seek to named marker\n\n### Signals\n\n- `started()` - Animation started\n- `stopped()` - Animation stopped\n- `finished()` - Animation finished\n- `positionChanged(real)` - Position changed\n- `frameChanged(int)` - Frame changed\n- `markerReached(string)` - Marker reached\n- `error(string)` - Error occurred\n\n## Performance\n\nThe library is designed for optimal performance with Qt-style size-based frame caching.\n\n### Cache Modes\n\n- `CacheNone`: Render frames on demand (default, lowest memory)\n- `CacheLoop`: Cache one complete animation loop\n- `CacheAll`: Cache entire animation (best performance for small animations)\n\n## Requirements\n\n- Python 3.8+\n- PySide6 or PyQt6  \n- rlottie-python\n- Pillow (for image processing)\n\n## License\n\nMIT License - see LICENSE file for details.\n\n## Development\n\n### Setup\n```bash\n# Clone repository\ngit clone https://gitlab.com/acemetrics-oss/qt-lottie.git\ncd qt-lottie\n\n# Install in development mode\npip install -e \".[dev,pyside6,pyqt6]\"\n```\n\n### Building\n```bash\n# Build package\npython -m build\n\n# Install from wheel\npip install dist/*.whl\n\n# Test basic functionality\npython -c \"import qtlottie; print('\u2713 Import successful')\"\n```\n\n### Testing\n```bash\n# Test examples\ncd examples/pyside6\npython main.py\n\ncd ../pyqt6  \npython main.py\n```\n\n## Contributing\n\nContributions welcome! Please see our [GitLab repository](https://gitlab.com/acemetrics-oss/qt-lottie) for guidelines.\n\n## Links\n\n- **PyPI**: https://pypi.org/project/qt-lottie/\n- **Source Code**: https://gitlab.com/acemetrics-oss/qt-lottie\n- **Issues**: https://gitlab.com/acemetrics-oss/qt-lottie/-/issues\n- **Examples**: See examples/ directory in the repository\n\n## Support\n\n- **Issues**: Report bugs and request features on [GitLab Issues](https://gitlab.com/acemetrics-oss/qt-lottie/-/issues)\n- **Documentation**: Full API reference available in the repository\n- **Examples**: Working examples for both PySide6 and PyQt6 included\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Cross-platform Python library providing Lottie animation support for Qt applications",
    "version": "0.1.1",
    "project_urls": {
        "Bug Tracker": "https://gitlab.com/acemetrics-oss/qt-lottie/-/issues",
        "Homepage": "https://gitlab.com/acemetrics-oss/qt-lottie",
        "Repository": "https://gitlab.com/acemetrics-oss/qt-lottie.git",
        "Source Code": "https://gitlab.com/acemetrics-oss/qt-lottie"
    },
    "split_keywords": [
        "qt",
        " lottie",
        " animation",
        " qml",
        " pyside6",
        " pyqt6",
        " graphics"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "710b4d0e339df408575152a50ffaf5dc580166527a34edd2154a08abb7154098",
                "md5": "d56f4a91ac7505b33da9fefeb5a2e72e",
                "sha256": "fb08343b09b64efdc3fb83c96a98b036e7a69c014ed023af4d1c866024c643e0"
            },
            "downloads": -1,
            "filename": "qt_lottie-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d56f4a91ac7505b33da9fefeb5a2e72e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 20769,
            "upload_time": "2025-07-25T11:31:05",
            "upload_time_iso_8601": "2025-07-25T11:31:05.150439Z",
            "url": "https://files.pythonhosted.org/packages/71/0b/4d0e339df408575152a50ffaf5dc580166527a34edd2154a08abb7154098/qt_lottie-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "9b38c75d263c41e38d001f75d61dc9e3962924473f39eeec2be7b293fa456b65",
                "md5": "66c97b79f7fe9bd2c5704c10bc73117b",
                "sha256": "4db4639e08cc0b596d02cb2e88c4f953187e92782f20501f536a54bf97f90571"
            },
            "downloads": -1,
            "filename": "qt_lottie-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "66c97b79f7fe9bd2c5704c10bc73117b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 24752,
            "upload_time": "2025-07-25T11:31:06",
            "upload_time_iso_8601": "2025-07-25T11:31:06.279140Z",
            "url": "https://files.pythonhosted.org/packages/9b/38/c75d263c41e38d001f75d61dc9e3962924473f39eeec2be7b293fa456b65/qt_lottie-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-25 11:31:06",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "acemetrics-oss",
    "gitlab_project": "qt-lottie",
    "lcname": "qt-lottie"
}
        
Elapsed time: 2.02705s