or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/asyncstdlib@3.13.x
tile.json

tessl/pypi-asyncstdlib

tessl install tessl/pypi-asyncstdlib@3.13.0

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

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%

task.mdevals/scenario-9/

Async Data Validator

A library for validating streams of data from async sources with boolean checks.

Capabilities

Validate all items pass checks

Implement validation that checks if all items in an async stream satisfy given criteria.

  • When checking async iterable [1, 2, 3, 4], validate_all_positive returns True @test
  • When checking async iterable [1, -2, 3], validate_all_positive returns False @test
  • When checking empty async iterable, validate_all_positive returns True @test

Validate any item passes checks

Implement validation that checks if any item in an async stream satisfies given criteria.

  • When checking async iterable [1, 2, 3] with validator that accepts even numbers, validate_any_valid returns True @test
  • When checking async iterable [1, 3, 5] with validator that accepts even numbers, validate_any_valid returns False @test
  • When checking empty async iterable with any validator, validate_any_valid returns False @test

Validate with async predicates

Support validation using async predicate functions for complex checks.

  • When checking async iterable ["apple", "banana"] with async predicate that checks string length > 3, validate_all_with_predicate returns True @test
  • When checking async iterable ["hi", "hello"] with async predicate that checks string length > 3, validate_all_with_predicate returns False @test

Implementation

@generates

API

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
    """
    pass

Dependencies { .dependencies }

asyncstdlib { .dependency }

Provides async-compatible versions of standard library functions for working with async iterables.

@satisfied-by