{"id":16606316,"url":"https://github.com/niklashenning/pyqtcountup","last_synced_at":"2025-10-29T15:31:52.611Z","repository":{"id":243123001,"uuid":"807308236","full_name":"niklashenning/pyqtcountup","owner":"niklashenning","description":"A simple numerical data animation library for PyQt and PySide labels","archived":false,"fork":false,"pushed_at":"2024-06-07T11:26:41.000Z","size":32,"stargazers_count":9,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-14T02:43:50.205Z","etag":null,"topics":["animation","countup","data","label","numerical","pyqt","pyqt5","pyqt6","pyside","pyside2","pyside6","python"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/pyqtcountup/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/niklashenning.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-28T21:15:38.000Z","updated_at":"2025-01-16T10:37:58.000Z","dependencies_parsed_at":"2024-06-06T21:28:55.307Z","dependency_job_id":"f37cac8b-4b97-4a0b-917f-b1ec9de77ff9","html_url":"https://github.com/niklashenning/pyqtcountup","commit_stats":null,"previous_names":["niklashenning/pyqtcountup"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklashenning%2Fpyqtcountup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklashenning%2Fpyqtcountup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklashenning%2Fpyqtcountup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklashenning%2Fpyqtcountup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/niklashenning","download_url":"https://codeload.github.com/niklashenning/pyqtcountup/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238848223,"owners_count":19540844,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["animation","countup","data","label","numerical","pyqt","pyqt5","pyqt6","pyside","pyside2","pyside6","python"],"created_at":"2024-10-12T01:07:37.014Z","updated_at":"2025-10-29T15:31:52.241Z","avatar_url":"https://github.com/niklashenning.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PyQt CountUp\n\n[![PyPI](https://img.shields.io/badge/pypi-v1.0.0-blue)](https://pypi.org/project/pyqtcountup/)\n[![Python](https://img.shields.io/badge/python-3.7+-blue)](https://github.com/niklashenning/pyqtcountup)\n[![Build](https://img.shields.io/badge/build-passing-neon)](https://github.com/niklashenning/pyqtcountup)\n[![Coverage](https://img.shields.io/badge/coverage-100%25-green)](https://github.com/niklashenning/pyqtcountup)\n[![License](https://img.shields.io/badge/license-MIT-green)](https://github.com/niklashenning/pyqtcountup/blob/master/LICENSE)\n\nA simple numerical data animation library for PyQt and PySide labels inspired by [countUp.js](https://github.com/inorganik/CountUp.js)\n\n![pyqtcountup](https://github.com/niklashenning/pyqtcountup/assets/58544929/0e6a2b8b-e4c6-493c-a007-86c5be3011d3)\n\n## Features\n* Customizable decimal places\n* Customizable decimal separator and thousands separator\n* Customizable prefix and suffix\n* Supports 41 different easing curves\n* Works with `PyQt5`, `PyQt6`, `PySide2`, and `PySide6`\n\n## Installation\n```\npip install pyqtcountup\n```\n\n## Usage\nImport the `CountUp` class, instantiate it with a label, and start the animation by calling the `start()` method:\n\n```python\nfrom PyQt6.QtWidgets import QMainWindow, QLabel\nfrom pyqtcountup import CountUp\n\n\nclass Window(QMainWindow):\n    def __init__(self):\n        super().__init__(parent=None)\n        \n        # Create label to show the animation on\n        countup_label = QLabel(self)\n        \n        # Init and start animation with duration of 2.5 seconds\n        countup = CountUp(countup_label)\n        countup.setStartValue(1000)\n        countup.setEndValue(7241)\n        countup.setDuration(2500)\n        countup.start()\n```\n\nUse the `update()` method to update the end value of a running animation (can also be used if the animation is already finished):\n```python\n# Start animation with 2500 as end value\ncountup.setEndValue(2500)\ncountup.start()\n\n# Update end value of the animation to be 1500\ncountup.update(1500)\n```\n\nTo pause and resume an animation, use the `pause()` and `resume()` methods:\n```python\n# Temporarily stop the animation with the option to resume it\ncountup.pause()\n\n# Resume the animation at the point where it was stopped\ncountup.resume()\n```\n\n\u003e **NOTE:** \u003cbr\u003eOnly paused animations can be resumed, so calling `resume()` after using the `stop()` method will not work.\n\n\nIf you want to stop an animation completely, you can use the `stop()` method:\n```python\ncountup.stop()\n```\n\nIf you want to stop the animation and also reset the label to the start value, you can use the `reset()` method:\n```python\ncountup.reset()\n```\n\nTo check if the animation is currently running or paused, use the `isRunning()` and `isPaused()` methods: \n```python\n# True if the animation is currently running, otherwise False\nis_running = countup.isRunning()\n\n# True if the animation is currently paused and can be resumed, otherwise False\nis_paused = countup.isPaused()\n```\n\n## Customization\n* **Setting the start and end values of the animation:**\n```python\ncountup.setStartValue(-1000)\ncountup.setEndValue(2500)\n\n# Alternatively\ncountup.setStartEndValues(-1000, 2500)\n```\n\n* **Setting the duration of the animation:**\n```python\ncountup.setDuration(2500)  # 2500 milliseconds = 2.5 seconds\n```\n\n* **Customizing the formatting of the number:**\n```python\ncountup.setDecimalPlaces(2)  # Default: 0\ncountup.setDecimal(',')      # Default: '.'\ncountup.setSeparator('.')    # Default: ''\n```\n\u003e **EXAMPLE:** \u003cbr\u003eThe value `1052` formatted with two decimal places, `,` as the decimal, and `.` as the separator would be `1.052,00`\n\n* **Adding a prefix and a suffix:**\n```python\ncountup.setPrefix('~')   # Default: ''\ncountup.setSuffix('€')  # Default: ''\n```\n\u003e **EXAMPLE:** \u003cbr\u003eThe value `100` formatted with `~` as the prefix and `€` as the suffix would be shown as `~100€`\n\n* **Making the prefix show between the minus and the number for negative values:**\n```python\ncountup.setPrefixBeforeMinus(False)  # Default: True\n```\n\u003e **EXAMPLE:** \u003cbr\u003eThe value `100` formatted with `$` as the prefix and `setPrefixBeforeMinus(False)` would be shown as `-$100` instead of `$-100`\n\n* **Customizing the easing of the animation:**\n```python\ncountup.setEasing(QEasingCurve.Type.OutCubic)  # Default: QEasingCurve.Type.OutExpo\n\n# Using no easing (same as QEasingCurve.Type.Linear)\ncountup.setEasing(None)\n```\n\u003e **AVAILABLE EASING CURVES:** \u003cbr\u003e `Linear`, `InQuad`, `OutQuad`, `InOutQuad`, `OutInQuad`, `InCubic`, `OutCubic`,\n\u003e `InOutCubic`, `OutInCubic`, `InQuart`, `OutQuart`, `InOutQuart`, `OutInQuart`, `InQuint`, `OutQuint`, `InOutQuint`,\n\u003e `OutInQuint`, `InSine`, `OutSine`, `InOutSine`, `OutInSine`, `InExpo`, `OutExpo`, `InOutExpo`, `OutInExpo`,\n\u003e `InCirc`, `OutCirc`, `InOutCirc`, `OutInCirc`, `InElastic`, `OutElastic`, `InOutElastic`, `OutInElastic`,\n\u003e `InBack`, `OutBack`, `InOutBack`, `OutInBack`, `InBounce`, `OutBounce`, `InOutBounce`, `OutInBounce`\n\u003e \u003cbr\u003eYou can find visualizations of these easing curves in the [PyQt documentation](https://doc.qt.io/qtforpython-5/PySide2/QtCore/QEasingCurve.html).\n\nExamples for PyQt5, PyQt6, and PySide6 can be found in the [demo](https://github.com/niklashenning/pyqtcountup/blob/master/demo) folder.\n\n## Tests\nInstalling the required test dependencies [PyQt6](https://pypi.org/project/PyQt6/), [pytest](https://github.com/pytest-dev/pytest), and [coveragepy](https://github.com/nedbat/coveragepy):\n```\npip install PyQt6 pytest coverage\n```\n\nTo run the tests with coverage, clone this repository, go into the main directory and run:\n```\ncoverage run -m pytest\ncoverage report --ignore-errors -m\n```\n\n## License\nThis software is licensed under the [MIT license](https://github.com/niklashenning/pyqtcountup/blob/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniklashenning%2Fpyqtcountup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fniklashenning%2Fpyqtcountup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniklashenning%2Fpyqtcountup/lists"}