python-debouncer


Namepython-debouncer JSON
Version 0.1.3 PyPI version JSON
download
home_page
SummaryDebouncer and friends for Python
upload_time2023-12-31 21:43:27
maintainer
docs_urlNone
authorSassan Haradji
requires_python>=3.9,<4.0
licenseApache-2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Asyncio Debouncer

## Description

This Python package provides a `debounce` decorator.
It's designed for rate-limiting function calls in asynchronous Python applications.

## 📋 Requirements

- Python 3.9 or later.
- [python-immutable](https://github.com/sassanh/python-immutable)

## 📦 Installation

The package handle in PyPI is `python-debouncer`

### Pip

```bash
pip install python-debouncer
```

### Poetry

```bash
poetry add python-debouncer
```

## 🛠 Usage

Import the decorator and apply it to your async functions:

```python
from debouncer import DebounceOptions, debounce

@debounce(wait=.5, options=DebounceOptions(trailing=True, leading=False, time_window=3))
async def your_function():
    # Function body
```

[Lodash documentation](https://lodash.com/docs/4.17.15#debounce)

### ⚠️ Important Note

`maxWait` in Lodash implementation is renamed to `time_window` here, I think semantically
it makes more sense.

## 🎉 Demo

See `demo.py` for a usage example.

## 🤝 Contributing

Contributions are welcome. Please fork the repository and open a pull request.

## 🔒 License

This project is released under the Apache-2.0 License. See the [LICENSE](./LICENSE)
file for more details.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "python-debouncer",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "Sassan Haradji",
    "author_email": "sassanh@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/ab/24/79af1ba42f05bb79920079d931ce3bbc1eb23aacedf43102a73331db4516/python_debouncer-0.1.3.tar.gz",
    "platform": null,
    "description": "# Asyncio Debouncer\n\n## Description\n\nThis Python package provides a `debounce` decorator.\nIt's designed for rate-limiting function calls in asynchronous Python applications.\n\n## \ud83d\udccb Requirements\n\n- Python 3.9 or later.\n- [python-immutable](https://github.com/sassanh/python-immutable)\n\n## \ud83d\udce6 Installation\n\nThe package handle in PyPI is `python-debouncer`\n\n### Pip\n\n```bash\npip install python-debouncer\n```\n\n### Poetry\n\n```bash\npoetry add python-debouncer\n```\n\n## \ud83d\udee0 Usage\n\nImport the decorator and apply it to your async functions:\n\n```python\nfrom debouncer import DebounceOptions, debounce\n\n@debounce(wait=.5, options=DebounceOptions(trailing=True, leading=False, time_window=3))\nasync def your_function():\n    # Function body\n```\n\n[Lodash documentation](https://lodash.com/docs/4.17.15#debounce)\n\n### \u26a0\ufe0f Important Note\n\n`maxWait` in Lodash implementation is renamed to `time_window` here, I think semantically\nit makes more sense.\n\n## \ud83c\udf89 Demo\n\nSee `demo.py` for a usage example.\n\n## \ud83e\udd1d Contributing\n\nContributions are welcome. Please fork the repository and open a pull request.\n\n## \ud83d\udd12 License\n\nThis project is released under the Apache-2.0 License. See the [LICENSE](./LICENSE)\nfile for more details.\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Debouncer and friends for Python",
    "version": "0.1.3",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bb40f1006ad40c32c930a9f627a486cbe1de3105891973427e2f946a82ebb61d",
                "md5": "8bd749141cda04ad877ddd52f5faab4b",
                "sha256": "25908a6ff1e28485c5ac346002d79597261357fbb7ee0fdf372365cac6fe796e"
            },
            "downloads": -1,
            "filename": "python_debouncer-0.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8bd749141cda04ad877ddd52f5faab4b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9,<4.0",
            "size": 7895,
            "upload_time": "2023-12-31T21:43:25",
            "upload_time_iso_8601": "2023-12-31T21:43:25.387930Z",
            "url": "https://files.pythonhosted.org/packages/bb/40/f1006ad40c32c930a9f627a486cbe1de3105891973427e2f946a82ebb61d/python_debouncer-0.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ab2479af1ba42f05bb79920079d931ce3bbc1eb23aacedf43102a73331db4516",
                "md5": "44fd4844f1a50145ae665f7b4bfa266f",
                "sha256": "b5bb28d28bfa0914cfcc52c6ee54f03543c1e003a23c3433a3d7bd304b4f9bbe"
            },
            "downloads": -1,
            "filename": "python_debouncer-0.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "44fd4844f1a50145ae665f7b4bfa266f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9,<4.0",
            "size": 7149,
            "upload_time": "2023-12-31T21:43:27",
            "upload_time_iso_8601": "2023-12-31T21:43:27.171752Z",
            "url": "https://files.pythonhosted.org/packages/ab/24/79af1ba42f05bb79920079d931ce3bbc1eb23aacedf43102a73331db4516/python_debouncer-0.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-31 21:43:27",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "python-debouncer"
}
        
Elapsed time: 0.22409s