Ctrl + k

or run

tessl search
Log in

Version

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

tessl/pypi-pylibmc

tessl install tessl/pypi-pylibmc@1.6.0

Quick and small memcached client for Python

Agent Success

Agent success rate when using this tile

86%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.04x

Baseline

Agent success rate without this tile

83%

task.mdevals/scenario-1/

Binary-Protected Cache Access

Configure a memcached client that always uses the binary protocol with SASL authentication and exposes a simple health check.

Capabilities

Binary protocol enforced

  • Creating a client without explicitly enabling the binary protocol raises an error before attempting any network operations. @test
  • Providing an empty server list results in a clear error instead of building a client with invalid configuration. @test

SASL credentials required

  • Omitting either username or password causes client creation to fail immediately with an authentication-related error. @test
  • When valid credentials are provided, the client is instantiated ready for authenticated requests without additional toggles. @test

Authenticated health check

  • A ping style call stores and retrieves a sentinel value using the authenticated client and returns True on success. @test
  • If the authenticated call fails due to bad credentials, the health check surfaces the authentication error instead of masking it. @test

Implementation

@generates

API

from dataclasses import dataclass
from typing import Iterable, Any

@dataclass
class CacheAuth:
    servers: Iterable[str]
    username: str
    password: str
    timeout: float | None = None

def build_authenticated_client(config: CacheAuth) -> Any:
    """Create a cache client that uses the binary protocol with SASL credentials, raising on invalid configuration."""


def ping_cache(client: Any, key: str = "__ping__", ttl: int = 5) -> bool:
    """Perform an authenticated write/read using the given client; returns True on success, raises on authentication failures."""

Dependencies { .dependencies }

pylibmc { .dependency }

Memcached client with binary protocol and SASL support.