limits の API リファレンス
limits (alisaifee/limits) の公開 API 59 件 —— クラス 22、関数 4、メソッド 33。実際のソースを静的解析して抽出した正確なシグネチャを掲載しています。
リポジトリ: alisaifee/limits
| 種別 | 件数 |
|---|---|
| クラス | 22 |
| 関数 | 4 |
| メソッド | 33 |
API 一覧
method
limits.aio.storage.base.Storage.check() -> boolcheck if storage is healthy
method
limits.aio.storage.base.Storage.clear(key:str) -> Noneresets the rate limit key :param key: the key to clear rate limits for
method
limits.aio.storage.base.Storage.get(key:str) -> int:param key: the key to get the counter value for
method
limits.aio.storage.base.Storage.get_expiry(key:str) -> float:param key: the key to get the expiry for
method
limits.aio.storage.base.Storage.reset() -> int | Nonereset storage to clear limits
class
limits.aio.storage.memcached.MemcachedStorageRate limit storage with memcached as backend.
method
limits.aio.storage.memcached.MemcachedStorage.clear(key:str) -> None:param key: the key to clear rate limits for
method
limits.aio.storage.memcached.MemcachedStorage.get(key:str) -> int:param key: the key to get the counter value for
method
limits.aio.storage.memcached.MemcachedStorage.get_expiry(key:str) -> float:param key: the key to get the expiry for
class
limits.aio.storage.mongodb.MongoDBStorageRate limit storage with MongoDB as backend.
method
limits.aio.storage.mongodb.MongoDBStorage.clear(key:str) -> None:param key: the key to clear rate limits for
method
limits.aio.storage.mongodb.MongoDBStorage.get(key:str) -> int:param key: the key to get the counter value for
method
limits.aio.storage.mongodb.MongoDBStorage.get_expiry(key:str) -> float:param key: the key to get the expiry for
class
limits.aio.storage.redis.RedisStorageRate limit storage with redis as backend.
method
limits.aio.storage.redis.RedisStorage.check() -> boolCheck if storage is healthy by calling ``PING``
method
limits.aio.storage.redis.RedisStorage.clear(key:str) -> None:param key: the key to clear rate limits for
method
limits.aio.storage.redis.RedisStorage.get(key:str) -> int:param key: the key to get the counter value for
method
limits.aio.storage.redis.RedisStorage.get_expiry(key:str) -> float:param key: the key to get the expiry for
class
limits.aio.strategies.FixedWindowRateLimiterReference: :ref:`strategies:fixed window`
class
limits.aio.strategies.MovingWindowRateLimiterReference: :ref:`strategies:moving window`
class
limits.aio.strategies.SlidingWindowCounterRateLimiterReference: :ref:`strategies:sliding window counter`
class
limits.errors.ConfigurationErrorError raised when a configuration problem is encountered
class
limits.errors.StorageErrorError raised when an error is encountered in a storage
class
limits.limits.RateLimitItemPerDayper day rate limited resource.
class
limits.limits.RateLimitItemPerHourper hour rate limited resource.
class
limits.limits.RateLimitItemPerMinuteper minute rate limited resource.
class
limits.limits.RateLimitItemPerMonthper month rate limited resource.
class
limits.limits.RateLimitItemPerSecondper second rate limited resource.
class
limits.limits.RateLimitItemPerYearper year rate limited resource.
func
limits.limits.safe_string(value:bytes | str | int | float) -> strnormalize a byte/str/int or float to a str
class
limits.storage.base.StorageBase class to extend when implementing a storage backend.
method
limits.storage.base.Storage.check() -> boolcheck if storage is healthy
method
limits.storage.base.Storage.clear(key:str) -> Noneresets the rate limit key :param key: the key to clear rate limits for
method
limits.storage.base.Storage.get(key:str) -> int:param key: the key to get the counter value for
method
limits.storage.base.Storage.get_expiry(key:str) -> float:param key: the key to get the expiry for
method
limits.storage.base.Storage.reset() -> int | Nonereset storage to clear limits
class
limits.storage.memcached.MemcachedStorageRate limit storage with memcached as backend.
method
limits.storage.memcached.MemcachedStorage.clear(key:str) -> None:param key: the key to clear rate limits for
method
limits.storage.memcached.MemcachedStorage.get(key:str) -> int:param key: the key to get the counter value for
method
limits.storage.memcached.MemcachedStorage.get_client(module:ModuleType, hosts:list[tuple[str, int]], **kwargs:str) -> MemcachedClientPreturns a memcached client.
method
limits.storage.memcached.MemcachedStorage.get_expiry(key:str) -> float:param key: the key to get the expiry for
class
limits.storage.mongodb.MongoDBStorageBaseRate limit storage with MongoDB as backend.
method
limits.storage.mongodb.MongoDBStorageBase.clear(key:str) -> None:param key: the key to clear rate limits for
method
limits.storage.mongodb.MongoDBStorageBase.get(key:str) -> int:param key: the key to get the counter value for
method
limits.storage.mongodb.MongoDBStorageBase.get_expiry(key:str) -> float:param key: the key to get the expiry for
class
limits.storage.redis.RedisStorageRate limit storage with redis as backend.
method
limits.storage.redis.RedisStorage.acquire_sliding_window_entry(key:str, limit:int, expiry:int, amount:int=1) -> boolAcquire an entry.
method
limits.storage.redis.RedisStorage.check() -> boolcheck if storage is healthy
method
limits.storage.redis.RedisStorage.clear(key:str) -> None:param key: the key to clear rate limits for
method
limits.storage.redis.RedisStorage.get(key:str) -> int:param key: the key to get the counter value for
method
limits.storage.redis.RedisStorage.get_expiry(key:str) -> float:param key: the key to get the expiry for
class
limits.strategies.FixedWindowRateLimiterReference: :ref:`strategies:fixed window`
class
limits.strategies.MovingWindowRateLimiterReference: :ref:`strategies:moving window`
method
limits.strategies.RateLimiter.test(item:RateLimitItem, *cost:int=1, *identifiers:str) -> boolCheck the rate limit without consuming from it.
class
limits.strategies.SlidingWindowCounterRateLimiterReference: :ref:`strategies:sliding window counter`
class
limits.util.WindowStatstuple to describe a rate limited window
func
limits.util.get_dependency(module_path:str) -> tuple[ModuleType, Version | None]safe function to import a module at runtime
func
limits.util.granularity_from_string(granularity_string:str) -> type[RateLimitItem]:param granularity_string: :raise ValueError:
func
limits.util.parse(limit_string:str) -> RateLimitItemparses a single rate limit in string notation (e.g.
この情報について
掲載しているシグネチャは alisaifee/limits の公開ソースコードを
Python の ast モジュールで静的解析し、引数名・デフォルト値・
型注釈・戻り値型をそのまま抽出したものです。実装コードは保存していません。
詳しくは仕組みの解説をご覧ください。