Skip to main content

Asyncio Debouncer

Description

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

📋 Requirements

📦 Installation

The package handle in PyPI is python-debouncer

Pip

pip install python-debouncer

Poetry

poetry add python-debouncer

🛠 Usage

Import the decorator and apply it to your async functions:

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

⚠️ 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 file for more details.

Metadata

Release files for python-debouncer 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python-debouncer 0.1.5
File Size Uploaded
python_debouncer-0.1.5.tar.gz 7.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for python-debouncer 0.1.5
File Interpreter ABI Platform
python_debouncer-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 15.6 kB

Release files / python_debouncer-0.1.5.tar.gz

Download URL python_debouncer-0.1.5.tar.gz
Size 7.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ad4bc0229334f12cf0268a55c76ea98cb89a28f933c12fb556f92623e0c72b04
BLAKE2b-256 checksum
How to use checksums
98513c746a5a0925dce853f19a19705753d188ff3abe055ce9655dce1762dd92
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / python_debouncer-0.1.5-py3-none-any.whl

Download URL python_debouncer-0.1.5-py3-none-any.whl
Size 8.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d92bef943f169f93b5be79bc5c71e315f155ec7090e95c02a14c420ebdd4765d
BLAKE2b-256 checksum
How to use checksums
79066044f6ccc2b07755e8d3da794c79ac90daeaab1008470cc2484050c0366d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page