python-debouncer


Namepython-debouncer JSON
Version 0.1.5 PyPI version JSON
download
home_pageNone
SummaryDebouncer and friends for Python
upload_time2024-07-19 15:35:27
maintainerNone
docs_urlNone
authorSassan Haradji
requires_python<4.0,>=3.9
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": null,
    "name": "python-debouncer",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": "Sassan Haradji",
    "author_email": "sassanh@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/98/51/3c746a5a0925dce853f19a19705753d188ff3abe055ce9655dce1762dd92/python_debouncer-0.1.5.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\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Debouncer and friends for Python",
    "version": "0.1.5",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "79066044f6ccc2b07755e8d3da794c79ac90daeaab1008470cc2484050c0366d",
                "md5": "fe9e2299bd84bd0d2a1ae89cc4e1bb13",
                "sha256": "d92bef943f169f93b5be79bc5c71e315f155ec7090e95c02a14c420ebdd4765d"
            },
            "downloads": -1,
            "filename": "python_debouncer-0.1.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fe9e2299bd84bd0d2a1ae89cc4e1bb13",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 8204,
            "upload_time": "2024-07-19T15:35:26",
            "upload_time_iso_8601": "2024-07-19T15:35:26.044251Z",
            "url": "https://files.pythonhosted.org/packages/79/06/6044f6ccc2b07755e8d3da794c79ac90daeaab1008470cc2484050c0366d/python_debouncer-0.1.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "98513c746a5a0925dce853f19a19705753d188ff3abe055ce9655dce1762dd92",
                "md5": "f7e7df946eebf030d366fe0bb5f74bcc",
                "sha256": "ad4bc0229334f12cf0268a55c76ea98cb89a28f933c12fb556f92623e0c72b04"
            },
            "downloads": -1,
            "filename": "python_debouncer-0.1.5.tar.gz",
            "has_sig": false,
            "md5_digest": "f7e7df946eebf030d366fe0bb5f74bcc",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 7429,
            "upload_time": "2024-07-19T15:35:27",
            "upload_time_iso_8601": "2024-07-19T15:35:27.291188Z",
            "url": "https://files.pythonhosted.org/packages/98/51/3c746a5a0925dce853f19a19705753d188ff3abe055ce9655dce1762dd92/python_debouncer-0.1.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-19 15:35:27",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "python-debouncer"
}
        
Elapsed time: 0.25493s