Skip to main content

Ralipyard

PyPI - Python Version PyPI - Implementation PyPI

Python thread-safe rate limit semaphore for threading and async/await style built on Rust's library raliguard

Overview

For example, crate a semaphore that allows only 5 calls per 1 second

import asyncio
import time
import datetime

import ralipyard


async def task(sem: ralipyard.Semaphore, no: int):
    delay = sem.calc_delay()
    await asyncio.sleep(delay)
    print(f"Task {no=} executes its code at {time.monotonic():.5f}")


async def main():
    sem = ralipyard.Semaphore(
        access_times=5,
        per_period=datetime.timedelta(seconds=1)
    )
    tasks = [task(sem, i) for i in range(100)]
    await asyncio.gather(*tasks)


asyncio.run(main())

Output:

Task no=0 executes its code at 0.21575
Task no=4 executes its code at 1.22018
Task no=3 executes its code at 1.22022
Task no=2 executes its code at 1.22023
Task no=1 executes its code at 1.22024
Task no=9 executes its code at 2.21618
Task no=7 executes its code at 2.21622
Task no=8 executes its code at 2.21623
Task no=6 executes its code at 2.21624
Task no=5 executes its code at 2.21624
Task no=11 executes its code at 3.22016
Task no=10 executes its code at 3.22020
Task no=12 executes its code at 3.22021
Task no=14 executes its code at 3.22022
Task no=13 executes its code at 3.22023
...

Instalation

From PyPI:

python -m pip install ralipyard

Or from GitHub

python -m pip install https://github.com/deknowny/archive/ralipyard.zip

Documentation

It's unnecessary because the library has the only 1 class with the only 2 methods, visit stubs for more information

Metadata

Release files for ralipyard 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ralipyard 0.1.0
File Size Uploaded Provenance Actions
ralipyard-0.1.0.tar.gz 5.5 kB Without provenance Details for ralipyard-0.1.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for ralipyard 0.1.0
File Actions
ralipyard-0.1.0-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl PyPy 3.7 PyPy 3.7 7.3 Linux glibc 2.5+ x86-64 Details for ralipyard-0.1.0-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl
ralipyard-0.1.0-cp310-none-win_amd64.whl CPython 3.10 none Windows x86-64 Details for ralipyard-0.1.0-cp310-none-win_amd64.whl
ralipyard-0.1.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.5+ x86-64 Details for ralipyard-0.1.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl
ralipyard-0.1.0-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl CPython 3.10 CPython 3.10 macOS 10.9+ x86-64, macOS 11.0+ ARM64, macOS 10.9+ universal2 (ARM64, x86-64) Details for ralipyard-0.1.0-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
ralipyard-0.1.0-cp39-none-win_amd64.whl CPython 3.9 none Windows x86-64 Details for ralipyard-0.1.0-cp39-none-win_amd64.whl
ralipyard-0.1.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.5+ x86-64 Details for ralipyard-0.1.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
ralipyard-0.1.0-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl CPython 3.9 CPython 3.9 macOS 11.0+ ARM64, macOS 10.9+ universal2 (ARM64, x86-64), macOS 10.9+ x86-64 Details for ralipyard-0.1.0-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
ralipyard-0.1.0-cp38-none-win_amd64.whl CPython 3.8 none Windows x86-64 Details for ralipyard-0.1.0-cp38-none-win_amd64.whl
ralipyard-0.1.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.5+ x86-64 Details for ralipyard-0.1.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
ralipyard-0.1.0-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl CPython 3.8 CPython 3.8 macOS 11.0+ ARM64, macOS 10.9+ universal2 (ARM64, x86-64), macOS 10.9+ x86-64 Details for ralipyard-0.1.0-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
ralipyard-0.1.0-cp37-none-win_amd64.whl CPython 3.7 none Windows x86-64 Details for ralipyard-0.1.0-cp37-none-win_amd64.whl
ralipyard-0.1.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64 Details for ralipyard-0.1.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
ralipyard-0.1.0-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ universal2 (ARM64, x86-64), macOS 10.9+ x86-64, macOS 11.0+ ARM64 Details for ralipyard-0.1.0-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl

Total release size: 7.2 MB

Release files / ralipyard-0.1.0.tar.gz

Download URL ralipyard-0.1.0.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
abd621531909163c8e084e1aba9db22f73627a7bc755d8aa3559e8017ca65dac
BLAKE2b-256 checksum
How to use checksums
1517187acd86d870fc40865f8d9cee706ba97784151cc7d4b5f96af3a32ba6fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.12.17

Release files / ralipyard-0.1.0-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl

Download URL ralipyard-0.1.0-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Size 985.9 kB
Tags Linux glibc 2.5+ x86-64 PyPy 3.7 PyPy 3.7 7.3
SHA-256 checksum
How to use checksums
d877c3884275f3dd44e850791232daa115a8d51883b493eb3d3c138400835903
BLAKE2b-256 checksum
How to use checksums
9ab9ebbc1e7f922830ac3197ee9f8383a1d78d036fabccf7f1dfe46cf0ed324a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.12.17

Release files / ralipyard-0.1.0-cp310-none-win_amd64.whl

Download URL ralipyard-0.1.0-cp310-none-win_amd64.whl
Size 121.1 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
5fbffd7d753750ecfbdb04e1379e31d98a7b81e7c11faded499648f3fed9e5f4
BLAKE2b-256 checksum
How to use checksums
f53cf639ed4a6baa481d7070c60b76451bf1a538b703868d2b1538e235d99a7b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.12.17

Release files / ralipyard-0.1.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl

Download URL ralipyard-0.1.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Size 983.6 kB
Tags CPython 3.10 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
1ca78180d1501277f1ee858be8b7694985441c12f7e55db05d424af8c50b1639
BLAKE2b-256 checksum
How to use checksums
0c167be5b6e887fdbc95499817322991bdc9064ff29234d7cd757b6655258c94
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.12.17

Release files / ralipyard-0.1.0-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl

Download URL ralipyard-0.1.0-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Size 439.3 kB
Tags CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
459e1d6be5707a1e898e0bacaa90d1f4672eb86dabc11b75faa6fe0d32f6f574
BLAKE2b-256 checksum
How to use checksums
0be10f6ccd5295e6754222a3113f0c4d8d21d9d81ea1d6d4efc724cb88bf83cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.12.17

Release files / ralipyard-0.1.0-cp39-none-win_amd64.whl

Download URL ralipyard-0.1.0-cp39-none-win_amd64.whl
Size 121.4 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
583f82f82bd9771a4f929c39b3b863915f2517ddc07dfff8aeeaee5df1a24d69
BLAKE2b-256 checksum
How to use checksums
50a52275ffb02ee948130fdfe706d2f353b2664586d1834c6c3ccf310c52ac8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.12.17

Release files / ralipyard-0.1.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl

Download URL ralipyard-0.1.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Size 983.9 kB
Tags CPython 3.9 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
3cbd3d1f7bf3d844ddf6bf0ae9858ea75edd2f6194a25e62d950a24469bfda1f
BLAKE2b-256 checksum
How to use checksums
e71d47fa3f93231bcf1fe8f8b19490188ba7557fbee0fe790821cbf75c7e4c11
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.12.17

Release files / ralipyard-0.1.0-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl

Download URL ralipyard-0.1.0-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Size 439.5 kB
Tags CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
2dfbf90aae9944297382ae4f80817546110e377874ffc5d5a6693ca4e7650fca
BLAKE2b-256 checksum
How to use checksums
ab7090a7950edd672afcbd4c8fa5b1c23c0bc41d41cabe31c4b477bd5fce5db5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.12.17

Release files / ralipyard-0.1.0-cp38-none-win_amd64.whl

Download URL ralipyard-0.1.0-cp38-none-win_amd64.whl
Size 121.1 kB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
fcdd592ae991fb7637b3b923cc7febbe5bf8484a4ca881c8f31a95ac56bc7ea4
BLAKE2b-256 checksum
How to use checksums
0eae7de8432c0d07ec51ac2ebe6726e46c95fa70b0ef04e4678c6f082c56abc2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.12.17

Release files / ralipyard-0.1.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl

Download URL ralipyard-0.1.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Size 983.2 kB
Tags CPython 3.8 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
29dc3e6cceaccdb7abee32fedc4429f3f1a0da182e8670558267dfdec676dd4c
BLAKE2b-256 checksum
How to use checksums
d787dcbc151a6ca491f090674d61e4dfb4b318f70851a29412f3efb07c809f09
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.12.17

Release files / ralipyard-0.1.0-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl

Download URL ralipyard-0.1.0-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Size 439.1 kB
Tags CPython 3.8 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
bb2282d996e42b2bae3c7fa8d2588d387e24be9369364284f854e029e4505a81
BLAKE2b-256 checksum
How to use checksums
19826d2385020b70a7ef223df67fa8ae6fb16d1fd12c50b65bcdd8e3e4589fd7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.12.17

Release files / ralipyard-0.1.0-cp37-none-win_amd64.whl

Download URL ralipyard-0.1.0-cp37-none-win_amd64.whl
Size 121.0 kB
Tags CPython 3.7 Windows x86-64
SHA-256 checksum
How to use checksums
f9a9da3d0de20df098e2073e9f8ba597fed9a5836dc0e62aff0ac81b1977354e
BLAKE2b-256 checksum
How to use checksums
77ea99bb24fc4a77cb79309699145f8b4b9c50900dfdda2331708969eba6fdaa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.12.17

Release files / ralipyard-0.1.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl

Download URL ralipyard-0.1.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Size 983.3 kB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
41b51f13524028d2a23e75910b8869989ffba3f55c6f6c8a7bf10cd505b7a001
BLAKE2b-256 checksum
How to use checksums
aa94c7bcbda97d9d1e8dae7164fbc07ca6a9ef54206b23c0434b40d7ad971dbd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.12.17

Release files / ralipyard-0.1.0-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl

Download URL ralipyard-0.1.0-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Size 439.2 kB
Tags CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
a6f7426d825a724f6dbf058ad8b773000901ff7a5d0aadb6eb2e9ccae8fffa3e
BLAKE2b-256 checksum
How to use checksums
27c497ec5bc1942ca9f35fbde474ad11fc34f9b0e17f42388ec19aa20f8e7856
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.12.17

Security for ralipyard 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

14 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page