Metadata-Version: 2.1
Name: throttle-controller
Version: 0.0.1
Summary: A simple throttling controller
Home-page: https://github.com/kitsuyui/python-throttle-controller
Author: Yui Kitsu
Author-email: kitsuyui+github@kitsuyui.com
License: BSD-3-Clause
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: BSD License
Classifier: Intended Audience :: Developers
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Provides-Extra: dev
License-File: LICENSE

# throttle-controller

## Usage

```python
from throttle_controller import SimpleThrottleController

throttle = SimpleThrottleController(default_cooldown_time=3.0)
throttle.wait_if_needed("http://example.com/path/to/api")
throttle.record_use_time_as_now("http://example.com/path/to/api")
... # requests
throttle.wait_if_needed("http://example.com/path/to/api")  # wait 3.0 seconds
throttle.record_use_time_as_now("http://example.com/path/to/api")
```

# Caution

Currently this package supports only to use in single thread / single process use-cases.

# LICENSE

The 3-Clause BSD License. See also LICENSE file.


