CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-requests-cache

A persistent cache for python requests

76

1.26x
Overview
Eval results
Files

rubric.jsonevals/scenario-9/

{
  "context": "This criteria evaluates how well the engineer uses the requests-cache package to implement session-level expiration control using the expire_after parameter. The focus is on correct usage of CachedSession initialization with different expiration times and proper cache management.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "CachedSession import",
      "description": "Correctly imports CachedSession from requests_cache module",
      "max_score": 10
    },
    {
      "name": "Short expiration session",
      "description": "Creates a CachedSession instance with expire_after=5 (or timedelta(seconds=5)) for the posts endpoint",
      "max_score": 25
    },
    {
      "name": "Long expiration session",
      "description": "Creates a CachedSession instance with expire_after=3600 (or timedelta(hours=1) or timedelta(seconds=3600)) for the user endpoint",
      "max_score": 25
    },
    {
      "name": "HTTP GET requests",
      "description": "Uses the CachedSession's get() method (or request methods) to make HTTP requests instead of using plain requests.get()",
      "max_score": 20
    },
    {
      "name": "Cache clearing",
      "description": "Uses the session's clear() method or cache.clear() to clear all cached responses",
      "max_score": 10
    },
    {
      "name": "Automatic caching behavior",
      "description": "Leverages the automatic caching behavior where requests are transparently cached and reused within the expiration window without manual cache checks",
      "max_score": 10
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/pypi-requests-cache

tile.json