A persistent cache for python requests
76
{
"context": "This criteria evaluates how well an engineer uses the requests-cache package's Redis storage backend capability, including proper backend initialization with connection parameters, Redis-specific configuration, per-request expiration control, and cache management operations.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Redis Backend Initialization",
"description": "Uses CachedSession with backend='redis' parameter to initialize Redis storage backend",
"max_score": 25
},
{
"name": "Redis Connection Parameters",
"description": "Configures Redis connection with host and port parameters (e.g., host='localhost', port=6379) in CachedSession initialization",
"max_score": 20
},
{
"name": "Per-Request Expiration",
"description": "Uses expire_after parameter in individual request methods (e.g., session.get()) to set different expiration times for different request types (5 minutes for current weather, 1 hour for forecast)",
"max_score": 25
},
{
"name": "Cache Clear Operation",
"description": "Uses session.cache.clear() method to remove all cached responses",
"max_score": 15
},
{
"name": "Cache Contains Check",
"description": "Uses session.cache.contains() method to verify if a URL is present in the cache",
"max_score": 15
}
]
}Install with Tessl CLI
npx tessl i tessl/pypi-requests-cacheevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10