Observed since 21 Oct, 11:48 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
aiodecorator
Binance Python SDK
Python decorators for asyncio, including
Awaitable$ pip install aiodecorator
import time
import asyncio
from aiodecorator import (
throttle
)
async def run(throttle_type):
now = time.time()
# -----------------------------------------------------
# The throttled function is only called twice a second
@throttle(2, 1, throttle_type)
async def throttled(index: int):
await asyncio.sleep(0.1)
diff = format(time.time() - now, '.0f')
print(index, f'{diff}s')
# -----------------------------------------------------
loop = asyncio.get_running_loop()
tasks = [
loop.create_task(throttled(index))
for index in range(5)
]
await asyncio.wait(tasks)
asyncio.run(run('wait'))
# Output: queued
# 0 0s
# 1 0s
# 2 1s
# 3 1s
# 4 2s
asyncio.run(run('ignore'))
# Output: 2, 3, 4 are ignored
# 0 0s
# 1 0s
asyncio.run(run('replace'))
# Output: 1, 2, 3 are canceled
# 0 0s
# 4 0s
int Maximum number of calls within an interval.Union[int, float] Timespan for limit in seconds.Literal['ignore', 'wait', 'replace'] = 'ignore'
None if it exceeds the limit.None and execute the current function call. (New in 3.1.0)Returns a decorator function
Literal['secondly', 'minutely', 'hourly', 'daily', 'weekly', 'monthly', 'yearly']timedelta = timedelta(seconds=0)Weekday only used when unit is 'weekly'Returns a decorator function that schedule a function fn to run from the next time moment with a delay delay
For example:
@schedule_natually('daily', delay = timedelta(seconds=50))
async def run():
print('hello')
await run()
# It will print 'hello' at 00:00:50 in the next day
@repeat(-1)
@schedule_naturally(
'weekly',
delay = timedelta(minutes=5),
weekday = 'Wednesday'
)
async def run_weekly():
print('hello')
await run_weekly()
# It will print 'hello' at 00:05 every Wednesday
int the number of times to repeat the functionfloat = 0. the interval between each call@repeat(7)
@schedule_naturally('daily')
@repeat(3, 0.1)
async def run()
print('hello')
await run()
# It will schedule a one-week plan, at 00:00:00 each day, it prints "hello" three times, with 100 ms between each print.
New in 3.1.0
int | None = None seconds to time out. If seconds <= 0 or seconds is None, there will be no timeout.at has higher priority than secondsMake the function automatically cancel itself if it takes longer than seconds seconds.
@timeout(1)
async def my_function():
await asyncio.sleep(2)
try:
await my_function():
except asyncio.TimeoutError:
print('timeout')
# It will print 'timeout'
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
codecovEnvironment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.6",
"evaluation": "NOT_EVALUATED"
} | codecov; extra == "dev" | runtime |
coverageEnvironment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.6",
"evaluation": "NOT_EVALUATED"
} | coverage; extra == "dev" | runtime |
ruffEnvironment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.6",
"evaluation": "NOT_EVALUATED"
} | ruff; extra == "dev" | runtime |
pytestEnvironment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.6",
"evaluation": "NOT_EVALUATED"
} | pytest; extra == "dev" | runtime |
pytest-asyncioEnvironment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.6",
"evaluation": "NOT_EVALUATED"
} | pytest-asyncio; extra == "dev" | runtime |
pytest-covEnvironment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.6",
"evaluation": "NOT_EVALUATED"
} | pytest-cov; extra == "dev" | runtime |
twineEnvironment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.6",
"evaluation": "NOT_EVALUATED"
} | twine; extra == "dev" | runtime |
setuptoolsEnvironment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.6",
"evaluation": "NOT_EVALUATED"
} | setuptools; extra == "dev" | runtime |
mypyEnvironment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.6",
"evaluation": "NOT_EVALUATED"
} | mypy; extra == "dev" | runtime |
buildEnvironment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.6",
"evaluation": "NOT_EVALUATED"
} | build; extra == "dev" | runtime |
bdist_wheel · 8.66 KB · Python py3
sdist · 10.18 KB · Python source
Shared repository data · GitHub
Public sponsor counts have not been collected. These signals belong to the repository owner.
github · 1 observations shown. Missing days are unknown.
| Date / source period | Value | Observed at |
|---|---|---|
| 2026-10-23 | 0 | 2026-10-23T22:31:26.0704803Z |
Observed since 21 Oct, 11:48 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:8d4e597b60b72887f4ffc1238cae8dafc9476ec3d941d314ca40cbfd9d26b5d5