The missing async toolbox - re-implements functions and classes of the Python standard library to make them compatible with async callables, iterables and context managers
84
Quality
Pending
Does it follow best practices?
Impact
84%
3.36xAverage score across 10 eval scenarios
Build a data analytics system that computes expensive metrics from datasets with proper caching to avoid redundant calculations.
Create a MetricsCalculator class that:
mean: The average value of the datasetvariance: The variance of the datasetstd_dev: The standard deviation of the datasetdel (e.g., del calculator.mean), after which the next access recomputes the value@generates
class MetricsCalculator:
"""
A class that computes statistical metrics from a dataset with caching.
"""
def __init__(self, data: list[float]):
"""
Initialize the calculator with a dataset.
Args:
data: A list of numeric values to analyze
"""
pass
async def mean(self) -> float:
"""
Calculate and cache the mean of the dataset.
Returns:
The mean (average) value
"""
pass
async def variance(self) -> float:
"""
Calculate and cache the variance of the dataset.
Returns:
The variance value
"""
pass
async def std_dev(self) -> float:
"""
Calculate and cache the standard deviation of the dataset.
Returns:
The standard deviation value
"""
passProvides async-compatible standard library functions including cached property support.
Install with Tessl CLI
npx tessl i tessl/pypi-asyncstdlibevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10