This release is a pre-release and may not be stable for production use.
Weller
Installation:
pip install weller
What is it?
weller it's a modern library for caching. It add a TTL cache per item, auto values refresh and also so easy interface for ruling this
What it includes:
- Weller - a automatic dispatcher for your perfect cache
- StrictCached and LazyCached - a simply TTL cache per item
- StrictAutoCached and LazyAutoCached - the same as the upper one, but with automatic values refresh
Strict and Lazy difference
This library has the concept of strict and lazy caches.
- First, the Lazy, deletes or refreshes only the data that you receive
- Second, the Strict, deletes or refreshes all data from a storage per any request
Usage examples:
import asyncio
from typing import Any, Annotated
from weller import Weller, Depends
from weller.dispather.storage import WellerMemoryStorage
storage = WellerMemoryStorage()
# If first_long = True, then first get of data will download all the data. Default False
weller = Weller(storage=storage, first_long=False)
async def get_db() -> dict[str, Any]:
return {"some_key": "some_data"}
@weller.add("some_long", duration=5)
async def get_long_data(db: Annotated[dict, Depends(get_db)]):
await asyncio.sleep(2)
return db.get("some_key")
async def main():
await weller.get("some_long") # it will take 2 seconds
await weller.get("some_long") # but it will be done instantly
asyncio.run(main())
You can see other examples in weller -> examples
Documentation:
In development and will be available soon
Roadmap:
- Add redis storage
- Work and with stability and security
Metadata
Release files for weller 0.0.0a1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| weller-0.0.0a1.tar.gz | 6.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| weller-0.0.0a1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.4 kB
Release files / weller-0.0.0a1.tar.gz
| Download URL | weller-0.0.0a1.tar.gz |
|---|---|
| Size | 6.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8742b5bbe06d09af3d2be5c2df7031136ec904e04b02e4df51545a78e79ab075
|
|
BLAKE2b-256 checksum How to use checksums |
06403a1cbd16ee0e7baef53bc367981800a92b658dd9b4bf105950969d341f37
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.11.4 Windows/10
|
Release files / weller-0.0.0a1-py3-none-any.whl
| Download URL | weller-0.0.0a1-py3-none-any.whl |
|---|---|
| Size | 9.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ec7a32e6f44ac07e67c14233d6a15af49bc4411a58cfc322b872003a68378080
|
|
BLAKE2b-256 checksum How to use checksums |
2edbd437cb18faadd67dc304e9afca6a7adc9c74802815356574363554de5cb9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.11.4 Windows/10
|
Security for weller 0.0.0a1
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.