Typed version of joblib's cache to support pydantic validation and type checking
Project description
Joblib Typed Cache
Joblib's cache functionality in joblib.Memory does not preserve type annotations of the underlying function.
That poses obstacles for pydantic validation and for modern type checkers and autocompletion in IDEs.
This package simply defines an incomplete adapter for the cache functionality.
Installation
uv add joblib-typed-cache
Usage
The package offers a drop-in replacement for joblib.Memory.cache.
from typed_joblib_cache import Memory
cache = Memory(location="~/.cache", verbose=0)
@cache(ignore=["db_connection"])
def get_user(user_id: str, db_connection: str) -> dict[str, str]:
# Simulate data retrieval
return {"user_id": user_id, "email": "john@example.com", "transaction_id": 42}
In this example, the function get_user will retain helpful tooltips in IDE and can also be used in conjunction with pydantic type validation.
import pydantic
get_user_validated = validate_call(get_user)
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 joblib_typed_cache-0.0.1.tar.gz.
File metadata
- Download URL: joblib_typed_cache-0.0.1.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce523f161182d2cc222aa13312fa84aaffe086fa3c8401eceb300c6b401ece1e
|
|
| MD5 |
19e716dd6ef85138965c84d8c5aa5a76
|
|
| BLAKE2b-256 |
90013ae6c49d587711ffb77b75d5cd62cc3fcd852e8f2181207edf8478c61523
|
Provenance
The following attestation bundles were made for joblib_typed_cache-0.0.1.tar.gz:
Publisher:
pypi.yml on szapp/joblib-typed-cache
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
joblib_typed_cache-0.0.1.tar.gz -
Subject digest:
ce523f161182d2cc222aa13312fa84aaffe086fa3c8401eceb300c6b401ece1e - Sigstore transparency entry: 1108155324
- Sigstore integration time:
-
Permalink:
szapp/joblib-typed-cache@ddb72aa32ec89736c2ada5d7e22e0e437796e186 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/szapp
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@ddb72aa32ec89736c2ada5d7e22e0e437796e186 -
Trigger Event:
push
-
Statement type:
File details
Details for the file joblib_typed_cache-0.0.1-py3-none-any.whl.
File metadata
- Download URL: joblib_typed_cache-0.0.1-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ce75fc0f5591806f8c8d94e48e1af1c1370d5fa2a4a847bd93b0884e893a8c9
|
|
| MD5 |
c7bb97692c0e87c2c68d4145e0d1ca8d
|
|
| BLAKE2b-256 |
29dea38bb7d2daf70711801ad9313c04a9dddeecfcb78a0ed8caa58661d28d5b
|
Provenance
The following attestation bundles were made for joblib_typed_cache-0.0.1-py3-none-any.whl:
Publisher:
pypi.yml on szapp/joblib-typed-cache
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
joblib_typed_cache-0.0.1-py3-none-any.whl -
Subject digest:
1ce75fc0f5591806f8c8d94e48e1af1c1370d5fa2a4a847bd93b0884e893a8c9 - Sigstore transparency entry: 1108155332
- Sigstore integration time:
-
Permalink:
szapp/joblib-typed-cache@ddb72aa32ec89736c2ada5d7e22e0e437796e186 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/szapp
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@ddb72aa32ec89736c2ada5d7e22e0e437796e186 -
Trigger Event:
push
-
Statement type: