No project description provided
Project description
malib
A few utilities that I find useful.
RateLimiter
from malib import RateLimiter
# call a function at most 10 times per minute
rl = RateLimiter(max_calls=10, period=60)
# call .wait() every time before calling the function
rl.wait()
Exact cover
Code inspired by this blog post.
from malib import exact_cover
piece_to_constraints = {"A": {1}, "B": {2, 4}, "C": {2, 3, 5}, "D": {3, 5}}
next(exact_cover(piece_to_constraints))
# ("A", "B", "D")
Testing
pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
malib-0.2.0.tar.gz
(2.4 kB
view details)
Built Distribution
malib-0.2.0-py3-none-any.whl
(2.8 kB
view details)
File details
Details for the file malib-0.2.0.tar.gz
.
File metadata
- Download URL: malib-0.2.0.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.1 CPython/3.8.8 Darwin/22.2.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 790400b14e1870ca323b167da811b5dcdf14c871e92d3683be72b23d6b968765 |
|
MD5 | 84dc6ef1406dbe58cc2ec52e294e255a |
|
BLAKE2b-256 | 6b9beefccc94c537c89848d51af361c08eb50eebe5e57dc4cf156777eae458c8 |
File details
Details for the file malib-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: malib-0.2.0-py3-none-any.whl
- Upload date:
- Size: 2.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.1 CPython/3.8.8 Darwin/22.2.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 070791fdaa2a9b23caf79a2c26e1e828d3133f13df158e42c1b382c636be7ffb |
|
MD5 | 8fdf1c55744aef6a579fcb6e18a2c482 |
|
BLAKE2b-256 | 077100c63749a2de8b9ef444b8de56f2aef4fdc1f2ef14596c9f4baabcc8a1d0 |