Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
.. image:: https://img.shields.io/badge/license-BSD-blue.svg :target: https://github.com/KonstantinTogoi/aiothrottles/blob/master/LICENSE
.. image:: https://img.shields.io/pypi/v/aiothrottles.svg :target: https://pypi.python.org/pypi/aiothrottles
.. image:: https://img.shields.io/pypi/pyversions/aiothrottles.svg :target: https://pypi.python.org/pypi/aiothrottles
.. image:: https://readthedocs.org/projects/aiothrottles/badge/?version=latest :target: https://aiothrottles.readthedocs.io/en/latest/
.. index-start-marker1
aiothrottles synchronization primitives are designed to be extension to
asyncio synchronization primitives <https://docs.python.org/3/library/asyncio-sync.html>
__.
For more details, see aiothrottles Documentation <https://konstantintogoi.github.io/aiothrottles>
_.
Throttle implements a rate limiting for asyncio task. A throttle can be used to guarantee limited access to a shared resources.
The preferred way to use a Throttle is an
async with <https://docs.python.org/3/reference/compound_stmts.html#async-with>
__ statement:
.. code-block:: python
throttle = Throttle('3/s')
# ... later
async with throttle:
# access shared state
which is equivalent to:
.. code-block:: python
throttle = Throttle('3/s')
# ... later
await throttle.acquire()
try:
# access shared state
finally:
throttle.release()
A call rate is determined by the :code:rate
argument.
Pass the rate in the following formats:
"{integer limit}/{unit time}"
"{limit's numerator}/{limit's denominator}{unit time}"
:code:rate
examples:
4/s
, :code:5/m
, :code:6/h
, :code:7/d
1/second
, :code:2/minute
, :code:3/hour
, :code:4/day
1/3s
, :code:12/37m
, :code:1/5h
, :code:8/3d
.. code-block:: shell
pip install aiothrottles
or
.. code-block:: shell
python setup.py install
Python 3.6, 3.7, 3.8 and 3.9 are supported.
.. index-end-marker1
Run all tests.
.. code-block:: shell
python setup.py test
Run tests with PyTest.
.. code-block:: shell
python -m pytest [-k TEST_NAME] [-m MARKER]
aiothrottles is released under the BSD 3-Clause License.
FAQs
Throttles for Python coroutines.
We found that aiothrottles demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.