Skip to main content

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

  1. 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
    
  2. Update version in pyproject.toml if needed:

    version = "0.1.8"
    
  3. Publish to PyPI:

    poetry publish
    

    Or 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

asynccachetools-0.1.8.tar.gz (2.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

asynccachetools-0.1.8-py3-none-any.whl (2.5 kB view details)

Uploaded Python 3

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

Hashes for asynccachetools-0.1.8.tar.gz
Algorithm Hash digest
SHA256 bab78cd5917ea8d702f89dea7c0f7f6ca69afd1259adc91b07ce179747bc5467
MD5 e35463365622403e53380d4e15735c1d
BLAKE2b-256 26e762ad5f51230790a75af6df23103fead03ce3f21c7627c08758ad50c1ac6d

See more details on using hashes here.

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

Hashes for asynccachetools-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 b557ff526ed03bcf6102e4c5adbc2b22c80d10fd5252e3af9019cf3e28205008
MD5 fd2464c2c2ec5e280317a05b581d5341
BLAKE2b-256 480b87274eddedf19804310ef891097d1d269e9891bbf48dfcaa0e629b3f11fb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page