{"library":"cachelib","code":"from cachelib import SimpleCache\n\n# Initialize an in-memory cache\ncache = SimpleCache(threshold=500, default_timeout=300)\n\n# Set a value\ncache.set(\"my_key\", \"my_value\", timeout=60)\n\n# Get a value\nvalue = cache.get(\"my_key\")\nprint(f\"Retrieved: {value}\")\n\n# Check if a key exists\nexists = cache.has(\"my_key\")\nprint(f\"Key 'my_key' exists: {exists}\")\n\n# Delete a key\ncache.delete(\"my_key\")\nexists_after_delete = cache.has(\"my_key\")\nprint(f\"Key 'my_key' exists after delete: {exists_after_delete}\")\n\n# Example with FileSystemCache (requires a directory)\nimport os\nimport tempfile\n\nwith tempfile.TemporaryDirectory() as temp_dir:\n    file_cache = FileSystemCache(cache_dir=os.path.join(temp_dir, \"cache\"), threshold=100)\n    file_cache.set(\"file_key\", \"file_value\", timeout=300)\n    file_value = file_cache.get(\"file_key\")\n    print(f\"Retrieved from file cache: {file_value}\")\n    file_cache.clear() # Clean up temporary cache dir","lang":"python","description":"This quickstart demonstrates how to initialize a `SimpleCache` (in-memory) and a `FileSystemCache` (file-based) to store, retrieve, check for existence, and delete cached values. It highlights basic `set`, `get`, `has`, and `delete` operations. For `FileSystemCache`, a temporary directory is used for demonstration purposes.","tag":null,"tag_description":null,"last_tested":"2026-04-24","results":[{"runtime":"python:3.10-alpine","exit_code":1},{"runtime":"python:3.10-slim","exit_code":1},{"runtime":"python:3.11-alpine","exit_code":1},{"runtime":"python:3.11-slim","exit_code":1},{"runtime":"python:3.12-alpine","exit_code":1},{"runtime":"python:3.12-slim","exit_code":1},{"runtime":"python:3.13-alpine","exit_code":1},{"runtime":"python:3.13-slim","exit_code":1},{"runtime":"python:3.9-alpine","exit_code":1},{"runtime":"python:3.9-slim","exit_code":1}]}