Skip to main content

Debouncer and friends for Python

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python_debouncer-0.1.5.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

python_debouncer-0.1.5-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file python_debouncer-0.1.5.tar.gz.

File metadata

  • Download URL: python_debouncer-0.1.5.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for python_debouncer-0.1.5.tar.gz
Algorithm Hash digest
SHA256 ad4bc0229334f12cf0268a55c76ea98cb89a28f933c12fb556f92623e0c72b04
MD5 f7e7df946eebf030d366fe0bb5f74bcc
BLAKE2b-256 98513c746a5a0925dce853f19a19705753d188ff3abe055ce9655dce1762dd92

See more details on using hashes here.

File details

Details for the file python_debouncer-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for python_debouncer-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 d92bef943f169f93b5be79bc5c71e315f155ec7090e95c02a14c420ebdd4765d
MD5 fe9e2299bd84bd0d2a1ae89cc4e1bb13
BLAKE2b-256 79066044f6ccc2b07755e8d3da794c79ac90daeaab1008470cc2484050c0366d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page