A wrapper over cachetools for use with asynchronous functions
Project description
AsyncCacheTools
A wrapper over cachetools for use with asynchronous functions.
Installation
pip install asynccachetools
Usage
from asynccachetools import acached
from cachetools import TTLCache
import asyncio
cache = TTLCache(maxsize=100, ttl=300)
@acached(cache=cache)
async def expensive_function(arg1, arg2):
# Your async function here
return result
Development
Building the package
# Build distribution packages
poetry build
This will create .whl and .tar.gz files in the dist/ directory.
Publishing to PyPI
-
Configure PyPI credentials (first time only):
poetry config pypi-token.pypi your-pypi-token
Or use username/password:
poetry config http-basic.pypi your-username your-password
-
Update version in
pyproject.tomlif needed:version = "0.1.8"
-
Publish to PyPI:
poetry publishOr publish to Test PyPI first:
poetry publish --repository testpypi
Local development setup
# Install dependencies
poetry install
# Run tests
poetry run pytest
# Run linter
poetry run flake8
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file asynccachetools-0.1.8.tar.gz.
File metadata
- Download URL: asynccachetools-0.1.8.tar.gz
- Upload date:
- Size: 2.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.1 CPython/3.12.11 Darwin/24.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bab78cd5917ea8d702f89dea7c0f7f6ca69afd1259adc91b07ce179747bc5467
|
|
| MD5 |
e35463365622403e53380d4e15735c1d
|
|
| BLAKE2b-256 |
26e762ad5f51230790a75af6df23103fead03ce3f21c7627c08758ad50c1ac6d
|
File details
Details for the file asynccachetools-0.1.8-py3-none-any.whl.
File metadata
- Download URL: asynccachetools-0.1.8-py3-none-any.whl
- Upload date:
- Size: 2.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.1 CPython/3.12.11 Darwin/24.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b557ff526ed03bcf6102e4c5adbc2b22c80d10fd5252e3af9019cf3e28205008
|
|
| MD5 |
fd2464c2c2ec5e280317a05b581d5341
|
|
| BLAKE2b-256 |
480b87274eddedf19804310ef891097d1d269e9891bbf48dfcaa0e629b3f11fb
|