Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (6.2%) to scientific vocabulary

Keywords from Contributors

mesh sequences interactive hacking network-simulation
Last synced: 8 months ago · JSON representation ·

Repository

Basic Info
  • Host: GitHub
  • Owner: CrowdStrike
  • License: mit
  • Language: Python
  • Default Branch: main
  • Size: 1.17 MB
Statistics
  • Stars: 1
  • Watchers: 5
  • Forks: 0
  • Open Issues: 11
  • Releases: 2
Created about 3 years ago · Last pushed over 2 years ago
Metadata Files
Readme Changelog Contributing License Code of conduct Citation Codeowners Security

README.md

CrowdStrike cs.ratelimit

cs.ratelimit

This provides a threadsafe configurable rate limiter to a Python callable.

It's easy to create a rate limited function ```python

from datetime import datetime, timedelta from cs import ratelimit @ratelimit.ratelimited(maxcount=1, interval=timedelta(seconds=1), block=False) ... def myfunc(): ... pass myfunc() try: ... myfunc() ... except ratelimit.RateLimitExceeded: ... print(u"Too fast!") Too fast! We can just as easily make it a blocking rate limiter python @ratelimit.ratelimited(maxcount=1, interval=timedelta(seconds=1), block=True) ... def myfunc(): ... pass myfunc() myfunc() # blocks, doesn't raise

```

It's also easy to create a class-level rate limited method ```python

class MyClass1: ... @ratelimit.ratelimitedmethod(maxcount=1, interval=timedelta(seconds=1), block=False) ... def mymethod(self): ... pass instance1 = MyClass1() instance2 = MyClass1() instance1.mymethod() try: ... instance2.mymethod() ... except ratelimit.RateLimitExceeded: ... print(u"Too fast!") Too fast! ```

A more advanced use case is per-instance limiters ```python

from operator import attrgetter class MyClass2: ... def init(self): ... self.rl = ratelimit.RateLimitProperties(maxcount=1, ... interval=timedelta(seconds=1), ... block=False) ... @ratelimit.ratelimitedmethod(attrgetter('rl')) ... def mymethod(self): ... pass instance1 = MyClass2() instance2 = MyClass2()

The rate limiters in these instances are independent

instance1.mymethod() instance2.mymethod() try: ... instance1.mymethod() ... except ratelimit.RateLimitExceeded: ... print(u"Too fast!") Too fast! They can also be updated at any time python with instance2.rl.rlock: #needed in threaded environments ... instance2.rl.maxcount = 2 instance2.my_method()

```



WE STOP BREACHES

Owner

  • Name: CrowdStrike
  • Login: CrowdStrike
  • Kind: organization
  • Email: github@crowdstrike.com
  • Location: United States of America

Citation (CITATION.cff)

cff-version: 1.2.0
title: 'cs.ratelimit: A threadsafe configurable rate limiter for Python callables'
message: >-
  If you use this software, and wish to cite the origins,
  please use metadata from this file.
type: software
authors:
  - given-names:
    family-names: CrowdStrike
    email: oss@crowdstrike.com
  - given-names: Dave
    family-names: Davis
    affiliation: CrowdStrike
repository-code: 'https://github.com/CrowdStrike/cs.ratelimit'
repository-artifact: 'https://pypi.org/project/cs-ratelimit/'
abstract: >-
  The cs.ratelimit package provides a rate limiter for any Python callable that
  can be configured via code or YAML and optionally wired together using the
  Zope Component Architecture.
keywords:
  - crowdstrike
  - ratelimit
  - zope
  - python
  - windows
  - linux
  - mac license: MIT

GitHub Events

Total
Last Year

Committers

Last synced: 10 months ago

All Time
  • Total Commits: 5
  • Total Committers: 2
  • Avg Commits per committer: 2.5
  • Development Distribution Score (DDS): 0.4
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
dependabot[bot] 4****] 3
Forrest Aldridge f****e@c****m 2
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 8 months ago

All Time
  • Total issues: 0
  • Total pull requests: 36
  • Average time to close issues: N/A
  • Average time to close pull requests: 11 days
  • Total issue authors: 0
  • Total pull request authors: 2
  • Average comments per issue: 0
  • Average comments per pull request: 0.56
  • Merged pull requests: 5
  • Bot issues: 0
  • Bot pull requests: 34
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
  • dependabot[bot] (34)
  • faldridge (2)
Top Labels
Issue Labels
Pull Request Labels
dependencies (34) python (33) github_actions (1)

Dependencies

.github/workflows/bandit.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/dev-deploy.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/flake8.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/pydocstyle.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/pylint.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/python-publish.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/unit_testing_macos.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/unit_testing_ubuntu.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/unit_testing_ubuntu_py3.8.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/unit_testing_windows.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
requirements-dev.txt pypi
  • astroid ==2.15.6 development
  • bandit ==1.7.5 development
  • coverage ==7.2.7 development
  • dill ==0.3.7 development
  • flake8 ==6.0.0 development
  • gitdb ==4.0.10 development
  • gitpython ==3.1.32 development
  • isort ==5.12.0 development
  • lazy-object-proxy ==1.9.0 development
  • markdown-it-py ==3.0.0 development
  • mccabe ==0.7.0 development
  • mdurl ==0.1.2 development
  • pbr ==5.11.1 development
  • platformdirs ==3.9.1 development
  • pycodestyle ==2.10.0 development
  • pydocstyle ==6.3.0 development
  • pyflakes ==3.0.1 development
  • pygments ==2.15.1 development
  • pylint ==2.17.5 development
  • pyyaml ==6.0.1 development
  • rich ==13.4.2 development
  • smmap ==5.0.0 development
  • snowballstemmer ==2.2.0 development
  • stevedore ==5.1.0 development
  • tomlkit ==0.12.1 development
  • wrapt ==1.15.0 development
  • zope-component ==6.0 development
  • zope-configuration ==5.0 development
  • zope-event ==5.0 development
  • zope-exceptions ==5.0.1 development
  • zope-hookable ==5.4 development
  • zope-i18nmessageid ==6.0.1 development
  • zope-interface ==6.0 development
  • zope-schema ==7.0.1 development
  • zope-testrunner ==6.0 development
requirements.txt pypi
  • zope-component ==6.0
  • zope-event ==5.0
  • zope-hookable ==5.4
  • zope-interface ==6.0
  • zope-schema ==7.0.1
setup.py pypi
  • setuptools *
  • zope.component *
  • zope.interface *
  • zope.schema *