tessl install tessl/pypi-asyncstdlib@3.13.0The missing async toolbox - re-implements functions and classes of the Python standard library to make them compatible with async callables, iterables and context managers
Agent Success
Agent success rate when using this tile
84%
Improvement
Agent success rate improvement when using this tile compared to baseline
3.36x
Baseline
Agent success rate without this tile
25%
A library for validating streams of data from async sources with boolean checks.
Implement validation that checks if all items in an async stream satisfy given criteria.
Implement validation that checks if any item in an async stream satisfies given criteria.
Support validation using async predicate functions for complex checks.
@generates
async def validate_all_positive(numbers) -> bool:
"""
Check if all numbers in an async iterable are positive.
Args:
numbers: An async iterable of numbers
Returns:
True if all numbers are positive (> 0), False otherwise
"""
pass
async def validate_any_valid(items, validator) -> bool:
"""
Check if any item in an async iterable passes a validation function.
Args:
items: An async iterable of items to validate
validator: A function (sync or async) that returns True for valid items
Returns:
True if at least one item is valid, False otherwise
"""
pass
async def validate_all_with_predicate(items, predicate) -> bool:
"""
Check if all items in an async iterable satisfy an async predicate.
Args:
items: An async iterable of items to check
predicate: An async function that returns True/False for each item
Returns:
True if all items satisfy the predicate, False otherwise
"""
passProvides async-compatible versions of standard library functions for working with async iterables.
@satisfied-by