{
  "id": "task_libraries:caching/python",
  "path": "/exapedia/python-caching-libraries",
  "template": {
    "id": "task_libraries",
    "version": 4
  },
  "title": "Python caching libraries",
  "answer": [
    {
      "t": "text",
      "text": "Python caching libraries store the result of an expensive call for reuse when a later call has the same inputs. A cache evicts entries by a policy such as least recently used or a time-to-live. These libraries let web apps and data pipelines skip repeated database queries, API calls, and computations."
    }
  ],
  "breadcrumb": [
    {
      "label": "Tools"
    },
    {
      "label": "Python caching libraries"
    }
  ],
  "sections": [
    {
      "id": "libraries_popularity",
      "anchor": "popularity",
      "heading": "Popularity",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "Monthly downloads",
            "Stars",
            "Last release",
            "License"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#cachetools",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F124"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F125"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F6"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F128"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F126"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#redis",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F138"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F139"
                }
              ],
              [
                {
                  "t": "text",
                  "text": "Not on GitHub"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F142"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F140"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#joblib",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F154"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F155"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F27"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F158"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F156"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#cachecontrol",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F168"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F169"
                }
              ],
              [
                {
                  "t": "text",
                  "text": "Not on GitHub"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F172"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F170"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#async-lru",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F184"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F185"
                }
              ],
              [
                {
                  "t": "text",
                  "text": "Not on GitHub"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F188"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F186"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#boltons",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F204"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F205"
                }
              ],
              [
                {
                  "t": "text",
                  "text": "Not on GitHub"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F208"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F206"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#diskcache",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F220"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F221"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F51"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F224"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F222"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#cachebox",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F234"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F235"
                }
              ],
              [
                {
                  "t": "text",
                  "text": "Not on GitHub"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F238"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F236"
                }
              ]
            ]
          ],
          "variant": "pop",
          "caption": [
            {
              "t": "text",
              "text": "Downloads: "
            },
            {
              "t": "text",
              "text": "PyPI"
            },
            {
              "t": "text",
              "text": ", last thirty days. Stars and releases: GitHub. Amber: no release in over a year."
            }
          ]
        }
      ],
      "note": [
        {
          "t": "link",
          "href": "#cachetools",
          "label": [
            {
              "t": "fact",
              "fact": "F1"
            }
          ]
        },
        {
          "t": "text",
          "text": " has the most monthly downloads in this comparison, at "
        },
        {
          "t": "fact",
          "fact": "F2"
        },
        {
          "t": "text",
          "text": "."
        }
      ]
    },
    {
      "id": "libraries_capabilities",
      "anchor": "capabilities",
      "heading": "Capabilities",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "Separate cache server required",
            "Local disk cache backend"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#cachetools",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F124"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F131"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F132"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#redis",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F138"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F147"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F148"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#joblib",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F154"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F161"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F162"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#cachecontrol",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F168"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F177"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F178"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#async-lru",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F184"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F193"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F194"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#boltons",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F204"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F213"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F214"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#diskcache",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F220"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F227"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F228"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#cachebox",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F234"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F243"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F244"
                }
              ]
            ]
          ],
          "variant": "cap"
        }
      ]
    },
    {
      "id": "libraries_entries",
      "anchor": "libraries",
      "heading": "Libraries",
      "blocks": [
        {
          "b": "entry",
          "anchor": "cachetools",
          "name": [
            {
              "t": "fact",
              "fact": "F124"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/tkem/cachetools"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/cachetools"
            },
            {
              "label": "Docs",
              "href": "https://cachetools.readthedocs.io/en/stable/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F12"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F125"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F6"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F127"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F126"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://cachetools.readthedocs.io/en/stable/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F124"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F13"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F14"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F15"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F16"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F17"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F18"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F19"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F20"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F136"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F137"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/streamlit/streamlit",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F136"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def __init__(self, persist_storage: CacheStorage, context: CacheStorageContext):\n    self.function_key = context.function_key\n    self.function_display_name = context.function_display_name\n    self._ttl_seconds = context.ttl_seconds\n    self._max_entries = context.max_entries\n    self._mem_cache: TTLCache[str, bytes] = TTLCache(\n        maxsize=self.max_entries,\n        ttl=self.ttl_seconds,\n        timer=cache_utils.TTLCACHE_TIMER,\n    )\n    self._mem_cache_lock = threading.Lock()\n    self._persist_storage = persist_storage",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/streamlit/streamlit/blob/bfcede21dec9bd0c5c69e6fb1ee88aa4a9381164/lib/streamlit/runtime/caching/storage/in_memory_cache_storage_wrapper.py",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F135"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Python%20projects%20using%20cachetools%20for%20persistent%20cache%20setup%2C%20function-result%20memoization%2C%20cached%20pipelines%2C%20query%20caching%20and%20invalidation&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F124"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from cachetools import TTLCache\n\ncache = TTLCache(maxsize=128, ttl=60)\ncache[\"answer\"] = 42\nprint(cache[\"answer\"])\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://api.github.com/repos/tkem/cachetools/contents/src/cachetools/__init__.py?ref=v8.0.2",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.rst"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F129"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "redis",
          "name": [
            {
              "t": "fact",
              "fact": "F138"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/redis/redis-py"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/redis"
            },
            {
              "label": "Docs",
              "href": "https://redis.readthedocs.io/en/v8.1.0/commands.html"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F145"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F139"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F141"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F140"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://redis.readthedocs.io/en/v8.1.0/commands.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F138"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F152"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F153"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/django/django",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F152"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def add(self, key, value, timeout):\n    client = self.get_client(key, write=True)\n    value = self._serializer.dumps(value)\n\n    if timeout == 0:\n        if ret := bool(client.set(key, value, nx=True)):\n            client.delete(key)\n        return ret\n    else:\n        return bool(client.set(key, value, ex=timeout, nx=True))",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/django/django/blob/9e2e5a31e2ef2e8673d3c2a38d2a391dbf42cf23/django/core/cache/backends/redis.py",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F151"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=redis%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F138"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import redis\n\nclient = redis.Redis(host=\"localhost\", port=6379, decode_responses=True)\nclient.set(\"answer\", \"42\")\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://redis.readthedocs.io/en/v8.1.0/commands.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "commands.html"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F143"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "joblib",
          "name": [
            {
              "t": "fact",
              "fact": "F154"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/joblib/joblib"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/joblib"
            },
            {
              "label": "Docs",
              "href": "https://joblib.readthedocs.io/en/stable/generated/joblib.Memory.html"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F33"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F155"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F27"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F157"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F156"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://joblib.readthedocs.io/en/stable/generated/joblib.Memory.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F154"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F34"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F35"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F36"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F37"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F38"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F39"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F166"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F167"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/scikit-learn-contrib/imbalanced-learn",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F166"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def _fit(self, X, y=None, routed_params=None, raw_params=None):\n    self.steps = list(self.steps)\n    self._validate_steps()\n    # Setup the memory\n    memory = check_memory(self.memory)\n\n    fit_transform_one_cached = memory.cache(_fit_transform_one)\n    fit_resample_one_cached = memory.cache(_fit_resample_one)\n\n    for step_idx, name, transformer in self._iter(\n        with_final=False, filter_passthrough=False, filter_resample=False\n    ):\n        if transformer is None or transformer == \"passthrough\":\n            with _print_elapsed_time(\"Pipeline\", self._log_message(step_idx)):\n                continue\n\n        if hasattr(memory, \"location\") and memory.location is None:\n            # we do not clone when caching is disabled to\n            # preserve backward compatibility\n            cloned_transformer = transformer\n        else:\n            cloned_transformer = clone(transformer)\n\n        # Fit or load from cache the current transformer\n        step_params = self._get_metadata_for_step(\n            step_idx=step_idx,\n            step_params=routed_params[name],\n            all_params=raw_params,\n        )\n        if hasattr(cloned_transformer, \"transform\") or hasattr(\n            cloned_transformer, \"fit_transform\"\n        ):\n            X, fitted_transformer = fit_transform_one_cached(\n                cloned_transformer,\n                X,\n                y,\n                weight=None,\n                message_clsname=\"Pipeline\",\n                message=self._log_message(step_idx),\n                params=step_params,\n            )\n        elif hasattr(cloned_transformer, \"fit_resample\"):\n            X, y, fitted_transformer = fit_resample_one_cached(\n                cloned_transformer,\n                X,\n                y,\n                message_clsname=\"Pipeline\",\n                message=self._log_message(step_idx),\n                params=routed_params[name],\n            )\n        # Replace the transformer of the step with the fitted\n        # transformer. This is necessary when loading the transformer\n        # from the cache.\n        self.steps[step_idx] = (name, fitted_transformer)\n    return X, y",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/scikit-learn-contrib/imbalanced-learn/blob/8504e95f0160f61d1b617ca66f779646d2ee609e/imblearn/pipeline.py",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F165"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Python%20projects%20using%20joblib%20for%20persistent%20cache%20setup%2C%20function-result%20memoization%2C%20cached%20pipelines%2C%20query%20caching%20and%20invalidation&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F154"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from joblib import Memory\n\nmemory = Memory(\"./cache\", verbose=0)\n\n@memory.cache\ndef square(value):\n    return value * value\n\nsquare(2)\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://joblib.readthedocs.io/en/stable/generated/joblib.Memory.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "memory_basic_usage.py"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F159"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "cachecontrol",
          "name": [
            {
              "t": "fact",
              "fact": "F168"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/psf/cachecontrol"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/CacheControl"
            },
            {
              "label": "Docs",
              "href": "https://api.github.com/repos/psf/cachecontrol/contents/cachecontrol/adapter.py?ref=v0.15.0"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F175"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F169"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F171"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F170"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://api.github.com/repos/psf/cachecontrol/contents/cachecontrol/adapter.py?ref=v0.15.0",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F168"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F182"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F183"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/python-poetry/poetry",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F182"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def create_session(self) -> requests.Session:\n    session = requests.Session()\n    session.headers[\"User-Agent\"] = self._user_agent\n\n    if self._cache_control is None:\n        return session\n\n    adapter = CacheControlAdapter(\n        cache=self._cache_control,\n        pool_maxsize=self._pool_size,\n    )\n    session.mount(\"http://\", adapter)\n    session.mount(\"https://\", adapter)\n\n    return session",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/python-poetry/poetry/blob/34ad5bf805506d78ef1bdef41d5ca2a343325150/src/poetry/utils/authenticator.py",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F181"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=CacheControl%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F168"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import requests\nfrom cachecontrol import CacheControl\n\nsession = CacheControl(requests.session())\nresponse = session.get(\"https://example.com\")\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://pypi.org/pypi/CacheControl/0.15.0/json",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.rst"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F173"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "async-lru",
          "name": [
            {
              "t": "fact",
              "fact": "F184"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/aio-libs/async-lru"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/async-lru"
            },
            {
              "label": "Docs",
              "href": "https://github.com/aio-libs/async-lru/blob/b43d835d026178c7bc0f0d2ad1c5ab7d5d16628d/README.rst"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F191"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F185"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F187"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F186"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://github.com/aio-libs/async-lru/blob/b43d835d026178c7bc0f0d2ad1c5ab7d5d16628d/README.rst",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F184"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F198"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F199"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/TracecatHQ/tracecat",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F198"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "@alru_cache(ttl=30)\nasync def _get_setting_cached_by_org(\n    key: str,\n    organization_id: OrganizationID | None,\n    default: Any | None = None,\n) -> Any | None:\n    \"\"\"Internal cached implementation keyed by (key, organization_id).\n\n    This ensures different organizations have isolated cache entries.\n    \"\"\"\n    logger.debug(\"Cache miss\", key=key, organization_id=organization_id)\n    role = ctx_role.get()\n    sess = ctx_session.get(None)\n    return await get_setting(key, role=role, session=sess, default=default)",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/TracecatHQ/tracecat/blob/3d9754d0c046b7605c8d6c39d12b227f1c35b1e5/tracecat/settings/service.py",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F197"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=async-lru%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F184"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F202"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F203"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/jupyterlab/jupyterlab",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F202"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def _configure_package_metadata_cache(self, _change: object = None) -> None:\n    self._fetch_package_metadata = cast(\n        \"FetchPackageMetadata\",\n        alru_cache(maxsize=self.package_metadata_cache_size)(\n            partial(_fetch_package_metadata, self._httpx_client)\n        ),\n    )\n    self._package_metadata_cache_expires = monotonic() + self.cache_timeout",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/jupyterlab/jupyterlab/blob/0d5e83530197cee73b15a11d2c2c29b168db6065/jupyterlab/extensions/pypi.py",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F201"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=async-lru%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F184"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import asyncio\nfrom async_lru import alru_cache\n\n@alru_cache(maxsize=32)\nasync def double(value):\n    return value * 2\n\nasyncio.run(double(2))\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/aio-libs/async-lru/blob/b43d835d026178c7bc0f0d2ad1c5ab7d5d16628d/README.rst",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.rst"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F189"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "boltons",
          "name": [
            {
              "t": "fact",
              "fact": "F204"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/mahmoud/boltons"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/boltons"
            },
            {
              "label": "Docs",
              "href": "https://boltons.readthedocs.io/en/latest/cacheutils.html"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F211"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F205"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F207"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F206"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://boltons.readthedocs.io/en/latest/cacheutils.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F204"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F218"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F219"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/scaleway/netbox-netprod-importer",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F218"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def _thread_push_device(device_mapper, caches, device, props,\n                        role_id, site_id):\n    device_type = props.pop(\"model\")\n    platform = props.pop(\"platform\", None)\n\n    name = str(device)\n    try:\n        device = next(device_mapper.get(name=name.lower()))\n    except StopIteration:\n        device = device_mapper.post(\n            name=name, slug=name.lower(),\n            device_type=caches[\"device_types\"][device_type.lower()],\n            device_role=role_id, site=site_id,\n        )\n\n    update_netbox_obj_from(device, props)\n    if platform:\n        device.platform = caches[\"platforms\"][platform.lower()]\n    device.put()",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/scaleway/netbox-netprod-importer/blob/0c2e8640bdaaaea4352c343c3f5b5f0f02c89cad/tools/push_devices.py",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F217"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=boltons%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F204"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from boltons.cacheutils import LRU\n\ncache = LRU(max_size=128)\ncache[\"answer\"] = 42\nprint(cache[\"answer\"])\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://boltons.readthedocs.io/en/latest/cacheutils.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "cacheutils.html"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F209"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "diskcache",
          "name": [
            {
              "t": "fact",
              "fact": "F220"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/grantjenks/python-diskcache"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/diskcache"
            },
            {
              "label": "Docs",
              "href": "https://grantjenks.com/docs/diskcache/api.html"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F57"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F221"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F51"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F223"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F222"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://grantjenks.com/docs/diskcache/api.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F220"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F58"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F59"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F60"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F61"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F62"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F63"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F232"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F233"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/dottxt-ai/outlines",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F232"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "@functools.lru_cache(1)\ndef get_cache():\n    \"\"\"Get the context object that contains previously-computed return values.\n\n    The cache is used to avoid unnecessary computations and API calls, which can\n    be long and expensive for large models.\n\n    The cache directory defaults to `HOMEDIR/.cache/outlines`, but this choice\n    can be overridden by the user by setting the value of the `OUTLINES_CACHE_DIR`\n    environment variable.\n\n    \"\"\"\n    from outlines._version import __version__ as outlines_version  # type: ignore\n\n    outlines_cache_dir = os.environ.get(\"OUTLINES_CACHE_DIR\")\n    xdg_cache_home = os.environ.get(\"XDG_CACHE_HOME\")\n    home_dir = os.path.normpath(os.path.expanduser(\"~\"))\n    if outlines_cache_dir:\n        # OUTLINES_CACHE_DIR takes precedence\n        cache_dir = outlines_cache_dir\n    elif xdg_cache_home:  # pragma: no cover\n        cache_dir = os.path.join(xdg_cache_home, \"outlines\")\n    elif home_dir != \"/\": # pragma: no cover\n        cache_dir = os.path.join(home_dir, \".cache\", \"outlines\")\n    else:  # pragma: no cover\n        # home_dir may be / inside a docker container without existing user\n        tempdir = tempfile.gettempdir()\n        cache_dir = os.path.join(tempdir, \".cache\", \"outlines\")\n\n    memory = Cache(\n        cache_dir,\n        eviction_policy=\"none\",\n        cull_limit=0,\n        disk=CloudpickleDisk,\n    )\n\n    # ensure if version upgrade occurs, old cache is pruned\n    if outlines_version != memory.get(\"__version__\"):\n        memory.clear()\n    memory[\"__version__\"] = outlines_version\n\n    return memory",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/dottxt-ai/outlines/blob/c52af8472c6fe8a607a733ec11b709476af77a96/src/outlines/caching.py",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F231"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Python%20projects%20using%20diskcache%20for%20persistent%20cache%20setup%2C%20function-result%20memoization%2C%20cached%20pipelines%2C%20query%20caching%20and%20invalidation&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F220"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from diskcache import Cache\n\nwith Cache(\"./cache\") as cache:\n    cache.set(\"answer\", 42)\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://grantjenks.com/docs/diskcache/api.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "api.html"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F225"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "cachebox",
          "name": [
            {
              "t": "fact",
              "fact": "F234"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/awolverp/cachebox"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/cachebox"
            },
            {
              "label": "Docs",
              "href": "https://awolverp.github.io/cachebox/getting-started/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F241"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F235"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F237"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F236"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://awolverp.github.io/cachebox/getting-started/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F234"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import cachebox\n\ncache = cachebox.LRUCache(maxsize=128)\ncache[\"answer\"] = 42\nprint(cache[\"answer\"])\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://awolverp.github.io/cachebox/getting-started/",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=cachebox%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "Find projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F234"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F239"
            }
          ]
        }
      ]
    }
  ],
  "questions": [
    {
      "q": "Which Python caching library should I use?",
      "a": [
        {
          "t": "link",
          "href": "#cachetools",
          "label": [
            {
              "t": "text",
              "text": "cachetools"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits in-process caches with LRU, TTL, and other eviction policies. "
        },
        {
          "t": "link",
          "href": "#redis",
          "label": [
            {
              "t": "text",
              "text": "redis-py"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits caches shared across processes and servers. "
        },
        {
          "t": "link",
          "href": "#diskcache",
          "label": [
            {
              "t": "text",
              "text": "diskcache"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits caches that must survive a restart on one machine."
        }
      ]
    },
    {
      "q": "How do I use Redis as a cache in Python?",
      "a": [
        {
          "t": "link",
          "href": "#redis",
          "label": [
            {
              "t": "text",
              "text": "redis-py"
            }
          ]
        },
        {
          "t": "text",
          "text": " is the Python client for Redis. A cache stores each result under a key with an expiry and reads that key before recomputing."
        }
      ]
    },
    {
      "q": "Redis vs Memcached: what is the difference?",
      "a": [
        {
          "t": "text",
          "text": "Redis stores strings and data structures such as hashes, lists, and sorted sets, with optional persistence. Memcached stores plain values in memory only and scales by adding nodes."
        }
      ]
    },
    {
      "q": "How do I add an LRU cache in Python?",
      "a": [
        {
          "t": "text",
          "text": "The standard library's functools.lru_cache decorator caches a function's results and evicts the least recently used entries. "
        },
        {
          "t": "link",
          "href": "#cachetools",
          "label": [
            {
              "t": "text",
              "text": "cachetools"
            }
          ]
        },
        {
          "t": "text",
          "text": " adds TTL caches, and "
        },
        {
          "t": "link",
          "href": "#async-lru",
          "label": [
            {
              "t": "text",
              "text": "async-lru"
            }
          ]
        },
        {
          "t": "text",
          "text": " covers coroutines."
        }
      ]
    },
    {
      "q": "What is diskcache?",
      "a": [
        {
          "t": "link",
          "href": "#diskcache",
          "label": [
            {
              "t": "text",
              "text": "diskcache"
            }
          ]
        },
        {
          "t": "text",
          "text": " stores cache entries in a SQLite database and the filesystem. Entries persist across restarts and can be shared between processes on the same machine."
        }
      ]
    }
  ],
  "facts": {
    "F1": {
      "label": "Library name, cachetools",
      "display": "cachetools",
      "asOf": "2026-11-17"
    },
    "F2": {
      "label": "Monthly downloads, cachetools",
      "display": "265.5M",
      "asOf": "2026-11-16"
    },
    "F3": {
      "label": "License, cachetools",
      "display": "MIT",
      "asOf": "2026-11-17"
    },
    "F4": {
      "label": "Package release, cachetools",
      "display": "8.0.0, Nov 2026",
      "asOf": "2026-11-07"
    },
    "F5": {
      "label": "Package release date, cachetools",
      "display": "Nov 2026",
      "asOf": "2026-11-07"
    },
    "F6": {
      "label": "Repository stars, cachetools",
      "display": "2.8K",
      "asOf": "2026-11-17"
    },
    "F7": {
      "label": "Expires cached values, cachetools",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F8": {
      "label": "Bounds cache size, cachetools",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F9": {
      "label": "Caches function results, cachetools",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F10": {
      "label": "Stores on disk, cachetools",
      "display": "Via plugin",
      "asOf": "2026-11-17"
    },
    "F11": {
      "label": "Install, cachetools",
      "display": "pip install cachetools",
      "asOf": "2026-11-17"
    },
    "F12": {
      "label": "What it does, cachetools",
      "display": "Provides cache mappings and decorators for function results.",
      "asOf": "2026-11-17"
    },
    "F13": {
      "label": "strengths lead, cachetools",
      "display": "Bounds retained cache values",
      "asOf": "2026-11-17"
    },
    "F14": {
      "label": "strengths, cachetools",
      "display": "Set maxsize to control how much the cache retains.",
      "asOf": "2026-11-17"
    },
    "F15": {
      "label": "strengths lead, cachetools",
      "display": "Supports custom value sizing",
      "asOf": "2026-11-17"
    },
    "F16": {
      "label": "strengths, cachetools",
      "display": "Use getsizeof when the cache budget should count value sizes.",
      "asOf": "2026-11-17"
    },
    "F17": {
      "label": "limitations lead, cachetools",
      "display": "Shared caches need synchronization",
      "asOf": "2026-11-17"
    },
    "F18": {
      "label": "limitations, cachetools",
      "display": "Protect a shared cache with a lock when multiple threads access it.",
      "asOf": "2026-11-17"
    },
    "F19": {
      "label": "limitations lead, cachetools",
      "display": "Expired entries can retain memory",
      "asOf": "2026-11-17"
    },
    "F20": {
      "label": "limitations, cachetools",
      "display": "Call expire to remove expired entries during read-only use.",
      "asOf": "2026-11-17"
    },
    "F21": {
      "label": "Quickstart, cachetools",
      "display": "from cachetools import cached, LRUCache, TTLCache\n\n# speed up calculating Fibonacci numbers with dynamic programming\n@cached(cache={})\ndef fib(n):\n    return n if n < 2 else fib(n - 1) + fib(n - 2)\n\n# cache least recently used Python Enhancement Proposals\n@cached(cache=LRUCache(maxsize=32))\ndef get_pep(num):\n    from urllib.request import urlopen\n    url = 'https://peps.python.org/pep-%04d/' % num\n    with urlopen(url) as s:\n        return s.read()\n",
      "asOf": "2026-11-17"
    },
    "F22": {
      "label": "Library name, joblib",
      "display": "joblib",
      "asOf": "2026-11-17"
    },
    "F23": {
      "label": "Monthly downloads, joblib",
      "display": "193.3M",
      "asOf": "2026-11-16"
    },
    "F24": {
      "label": "License, joblib",
      "display": "BSD-3-Clause",
      "asOf": "2026-11-17"
    },
    "F25": {
      "label": "Package release, joblib",
      "display": "1.6.0, Aug 2026",
      "asOf": "2026-08-31"
    },
    "F26": {
      "label": "Package release date, joblib",
      "display": "Aug 2026",
      "asOf": "2026-08-31"
    },
    "F27": {
      "label": "Repository stars, joblib",
      "display": "4.4K",
      "asOf": "2026-11-17"
    },
    "F28": {
      "label": "Expires cached values, joblib",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F29": {
      "label": "Bounds cache size, joblib",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F30": {
      "label": "Caches function results, joblib",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F31": {
      "label": "Stores on disk, joblib",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F32": {
      "label": "Install, joblib",
      "display": "pip install joblib numpy",
      "asOf": "2026-11-17"
    },
    "F33": {
      "label": "What it does, joblib",
      "display": "Caches function results on the filesystem for reuse with the same arguments.",
      "asOf": "2026-11-17"
    },
    "F34": {
      "label": "strengths lead, joblib",
      "display": "Caches function results on disk",
      "asOf": "2026-11-17"
    },
    "F35": {
      "label": "strengths, joblib",
      "display": "Reuse computed results through a named filesystem cache.",
      "asOf": "2026-11-17"
    },
    "F36": {
      "label": "strengths lead, joblib",
      "display": "Expires results through validation callbacks",
      "asOf": "2026-11-17"
    },
    "F37": {
      "label": "strengths, joblib",
      "display": "Use expires_after to recompute results after a chosen duration.",
      "asOf": "2026-11-17"
    },
    "F38": {
      "label": "limitations lead, joblib",
      "display": "Size limits need explicit cleanup",
      "asOf": "2026-11-17"
    },
    "F39": {
      "label": "limitations, joblib",
      "display": "Call reduce_size to enforce byte, item, or age limits.",
      "asOf": "2026-11-17"
    },
    "F40": {
      "label": "Quickstart, joblib",
      "display": "\"\"\"\n========================\nHow to use joblib.Memory\n========================\n\nThis example illustrates the usage of :class:`joblib.Memory` with both\nfunctions and methods.\n\n\"\"\"\n\n###############################################################################\n# Without :class:`joblib.Memory`\n###############################################################################\n#\n# ``costly_compute`` emulates a computationally expensive process which later\n# will benefit from caching using :class:`joblib.Memory`.\n\nimport time\n\nimport numpy as np\n\n\ndef costly_compute(data, column_index=0):\n    \"\"\"Simulate an expensive computation\"\"\"\n    time.sleep(5)\n    return data[column_index]\n\n\n###############################################################################\n# Be sure to set the random seed to generate deterministic data. Indeed, if the\n# data is not deterministic, the :class:`joblib.Memory` instance will not be\n# able to reuse the cache from one run to another.\n\nrng = np.random.RandomState(42)\ndata = rng.randn(int(1e5), 10)\nstart = time.time()\ndata_trans = costly_compute(data)\nend = time.time()\n\nprint(\"\\nThe function took {:.2f} s to compute.\".format(end - start))\nprint(\"\\nThe transformed data are:\\n {}\".format(data_trans))\n\n###############################################################################\n# Caching the result of a function to avoid recomputing\n###############################################################################\n#\n# If we need to call our function several times with the same input data, it is\n# beneficial to avoid recomputing the same results over and over since it is\n# expensive. :class:`joblib.Memory` enables to cache results from a function\n# into a specific location.\n\nfrom joblib import Memory\n\nlocation = \"./cachedir\"\nmemory = Memory(location, verbose=0)\n\n\ndef costly_compute_cached(data, column_index=0):\n    \"\"\"Simulate an expensive computation\"\"\"\n    time.sleep(5)\n    return data[column_index]\n\n\ncostly_compute_cached = memory.cache(costly_compute_cached)\nstart = time.time()\ndata_trans = costly_compute_cached(data)\nend = time.time()\n\nprint(\"\\nThe function took {:.2f} s to compute.\".format(end - start))\nprint(\"\\nThe transformed data are:\\n {}\".format(data_trans))\n\n###############################################################################\n# At the first call, the results will be cached. Therefore, the computation\n# time corresponds to the time to compute the results plus the time to dump the\n# results into the disk.\n\nstart = time.time()\ndata_trans = costly_compute_cached(data)\nend = time.time()\n\nprint(\"\\nThe function took {:.2f} s to compute.\".format(end - start))\nprint(\"\\nThe transformed data are:\\n {}\".format(data_trans))\n\n###############################################################################\n# At the second call, the computation time is largely reduced since the results\n# are obtained by loading the data previously dumped to the disk instead of\n# recomputing the results.\n\n###############################################################################\n# Using :class:`joblib.Memory` with a method\n###############################################################################\n#\n# :class:`joblib.Memory` is designed to work with functions with no side\n# effects. When dealing with class, the computationally expensive part of a\n# method has to be moved to a function and decorated in the class method.\n\n\ndef _costly_compute_cached(data, column):\n    time.sleep(5)\n    return data[column]\n\n\nclass Algorithm(object):\n    \"\"\"A class which is using the previous function.\"\"\"\n\n    def __init__(self, column=0):\n        self.column = column\n\n    def transform(self, data):\n        costly_compute = memory.cache(_costly_compute_cached)\n        return costly_compute(data, self.column)\n\n\ntransformer = Algorithm()\nstart = time.time()\ndata_trans = transformer.transform(data)\nend = time.time()\n\nprint(\"\\nThe function took {:.2f} s to compute.\".format(end - start))\nprint(\"\\nThe transformed data are:\\n {}\".format(data_trans))\n\n###############################################################################\n\nstart = time.time()\ndata_trans = transformer.transform(data)\nend = time.time()\n\nprint(\"\\nThe function took {:.2f} s to compute.\".format(end - start))\nprint(\"\\nThe transformed data are:\\n {}\".format(data_trans))\n\n###############################################################################\n# As expected, the second call to the ``transform`` method load the results\n# which have been cached.\n\n###############################################################################\n# Clean up cache directory\n###############################################################################\n\nmemory.clear(warn=False)\n",
      "asOf": "2026-11-17"
    },
    "F41": {
      "label": "Project function, joblib",
      "display": "def _fit(self, X, y=None, routed_params=None, raw_params=None):\n    self.steps = list(self.steps)\n    self._validate_steps()\n    # Setup the memory\n    memory = check_memory(self.memory)\n\n    fit_transform_one_cached = memory.cache(_fit_transform_one)\n    fit_resample_one_cached = memory.cache(_fit_resample_one)\n\n    for step_idx, name, transformer in self._iter(\n        with_final=False, filter_passthrough=False, filter_resample=False\n    ):\n        if transformer is None or transformer == \"passthrough\":\n            with _print_elapsed_time(\"Pipeline\", self._log_message(step_idx)):\n                continue\n\n        if hasattr(memory, \"location\") and memory.location is None:\n            # we do not clone when caching is disabled to\n            # preserve backward compatibility\n            cloned_transformer = transformer\n        else:\n            cloned_transformer = clone(transformer)\n\n        # Fit or load from cache the current transformer\n        step_params = self._get_metadata_for_step(\n            step_idx=step_idx,\n            step_params=routed_params[name],\n            all_params=raw_params,\n        )\n        if hasattr(cloned_transformer, \"transform\") or hasattr(\n            cloned_transformer, \"fit_transform\"\n        ):\n            X, fitted_transformer = fit_transform_one_cached(\n                cloned_transformer,\n                X,\n                y,\n                weight=None,\n                message_clsname=\"Pipeline\",\n                message=self._log_message(step_idx),\n                params=step_params,\n            )\n        elif hasattr(cloned_transformer, \"fit_resample\"):\n            X, y, fitted_transformer = fit_resample_one_cached(\n                cloned_transformer,\n                X,\n                y,\n                message_clsname=\"Pipeline\",\n                message=self._log_message(step_idx),\n                params=routed_params[name],\n            )\n        # Replace the transformer of the step with the fitted\n        # transformer. This is necessary when loading the transformer\n        # from the cache.\n        self.steps[step_idx] = (name, fitted_transformer)\n    return X, y\n",
      "asOf": "2026-11-17"
    },
    "F42": {
      "label": "Project function reference, joblib",
      "display": "pipeline.py · _fit()",
      "asOf": "2026-11-17"
    },
    "F43": {
      "label": "Project repository, joblib",
      "display": "scikit-learn-contrib/imbalanced-learn",
      "asOf": "2026-11-17"
    },
    "F44": {
      "label": "Project stars, scikit-learn-contrib/imbalanced-learn",
      "display": "7.1K",
      "asOf": "2026-11-17"
    },
    "F45": {
      "label": "Project push date, scikit-learn-contrib/imbalanced-learn",
      "display": "Jun 2026",
      "asOf": "2026-06-29"
    },
    "F46": {
      "label": "Library name, diskcache",
      "display": "DiskCache",
      "asOf": "2026-11-17"
    },
    "F47": {
      "label": "Monthly downloads, diskcache",
      "display": "25.1M",
      "asOf": "2026-11-16"
    },
    "F48": {
      "label": "License, diskcache",
      "display": "Apache-2.0",
      "asOf": "2026-11-17"
    },
    "F49": {
      "label": "Package release, diskcache",
      "display": "5.6.3, Aug 2023",
      "asOf": "2023-08-31"
    },
    "F50": {
      "label": "Package release date, diskcache",
      "display": "Aug 2023",
      "asOf": "2023-08-31"
    },
    "F51": {
      "label": "Repository stars, diskcache",
      "display": "2.9K",
      "asOf": "2026-11-17"
    },
    "F52": {
      "label": "Expires cached values, diskcache",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F53": {
      "label": "Bounds cache size, diskcache",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F54": {
      "label": "Caches function results, diskcache",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F55": {
      "label": "Stores on disk, diskcache",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F56": {
      "label": "Install, diskcache",
      "display": "pip install diskcache",
      "asOf": "2026-11-17"
    },
    "F57": {
      "label": "What it does, diskcache",
      "display": "Provides disk-backed caches using a SQLite database and filesystem storage.",
      "asOf": "2026-11-17"
    },
    "F58": {
      "label": "strengths lead, diskcache",
      "display": "Shares caches across processes",
      "asOf": "2026-11-17"
    },
    "F59": {
      "label": "strengths, diskcache",
      "display": "Use the same cache directory across threads and processes.",
      "asOf": "2026-11-17"
    },
    "F60": {
      "label": "strengths lead, diskcache",
      "display": "Expires individual entries",
      "asOf": "2026-11-17"
    },
    "F61": {
      "label": "strengths, diskcache",
      "display": "Set an expiration when writing each cache entry.",
      "asOf": "2026-11-17"
    },
    "F62": {
      "label": "limitations lead, diskcache",
      "display": "Database operations can time out",
      "asOf": "2026-11-17"
    },
    "F63": {
      "label": "limitations, diskcache",
      "display": "Handle Timeout or enable retries for supported cache operations.",
      "asOf": "2026-11-17"
    },
    "F64": {
      "label": "Quickstart, diskcache",
      "display": "from diskcache import Cache\ncache = Cache()\n@cache.memoize(expire=1, tag='fib')\ndef fibonacci(number):\n    if number == 0:\n        return 0\n    elif number == 1:\n        return 1\n    else:\n        return fibonacci(number - 1) + fibonacci(number - 2)\nprint(fibonacci(100))\n",
      "asOf": "2026-11-17"
    },
    "F65": {
      "label": "Project function, diskcache",
      "display": "@functools.lru_cache(1)\ndef get_cache():\n    \"\"\"Get the context object that contains previously-computed return values.\n\n    The cache is used to avoid unnecessary computations and API calls, which can\n    be long and expensive for large models.\n\n    The cache directory defaults to `HOMEDIR/.cache/outlines`, but this choice\n    can be overridden by the user by setting the value of the `OUTLINES_CACHE_DIR`\n    environment variable.\n\n    \"\"\"\n    from outlines._version import __version__ as outlines_version  # type: ignore\n\n    outlines_cache_dir = os.environ.get(\"OUTLINES_CACHE_DIR\")\n    xdg_cache_home = os.environ.get(\"XDG_CACHE_HOME\")\n    home_dir = os.path.normpath(os.path.expanduser(\"~\"))\n    if outlines_cache_dir:\n        # OUTLINES_CACHE_DIR takes precedence\n        cache_dir = outlines_cache_dir\n    elif xdg_cache_home:  # pragma: no cover\n        cache_dir = os.path.join(xdg_cache_home, \"outlines\")\n    elif home_dir != \"/\": # pragma: no cover\n        cache_dir = os.path.join(home_dir, \".cache\", \"outlines\")\n    else:  # pragma: no cover\n        # home_dir may be / inside a docker container without existing user\n        tempdir = tempfile.gettempdir()\n        cache_dir = os.path.join(tempdir, \".cache\", \"outlines\")\n\n    memory = Cache(\n        cache_dir,\n        eviction_policy=\"none\",\n        cull_limit=0,\n        disk=CloudpickleDisk,\n    )\n\n    # ensure if version upgrade occurs, old cache is pruned\n    if outlines_version != memory.get(\"__version__\"):\n        memory.clear()\n    memory[\"__version__\"] = outlines_version\n\n    return memory\n",
      "asOf": "2026-11-17"
    },
    "F66": {
      "label": "Project function reference, diskcache",
      "display": "caching.py · get_cache()",
      "asOf": "2026-11-17"
    },
    "F67": {
      "label": "Project repository, diskcache",
      "display": "dottxt-ai/outlines",
      "asOf": "2026-11-17"
    },
    "F68": {
      "label": "Project stars, dottxt-ai/outlines",
      "display": "16.0K",
      "asOf": "2026-11-17"
    },
    "F69": {
      "label": "Project push date, dottxt-ai/outlines",
      "display": "Sep 2026",
      "asOf": "2026-09-21"
    },
    "F70": {
      "label": "Library name, dogpile.cache",
      "display": "dogpile.cache",
      "asOf": "2026-11-17"
    },
    "F71": {
      "label": "Monthly downloads, dogpile.cache",
      "display": "2.1M",
      "asOf": "2026-11-16"
    },
    "F72": {
      "label": "License, dogpile.cache",
      "display": "MIT",
      "asOf": "2026-11-17"
    },
    "F73": {
      "label": "Package release, dogpile.cache",
      "display": "1.5.0, Oct 2025",
      "asOf": "2025-10-11"
    },
    "F74": {
      "label": "Package release date, dogpile.cache",
      "display": "Oct 2025",
      "asOf": "2025-10-11"
    },
    "F75": {
      "label": "Repository stars, dogpile.cache",
      "display": "302",
      "asOf": "2026-11-17"
    },
    "F76": {
      "label": "Expires cached values, dogpile.cache",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F77": {
      "label": "Caches function results, dogpile.cache",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F78": {
      "label": "Stores on disk, dogpile.cache",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F79": {
      "label": "Install, dogpile.cache",
      "display": "pip install dogpile.cache",
      "asOf": "2026-11-17"
    },
    "F80": {
      "label": "What it does, dogpile.cache",
      "display": "Provides a cache API with configurable backends and coordinated value creation.",
      "asOf": "2026-11-17"
    },
    "F81": {
      "label": "strengths lead, dogpile.cache",
      "display": "Coordinates cache refreshes",
      "asOf": "2026-11-17"
    },
    "F82": {
      "label": "strengths, dogpile.cache",
      "display": "One thread creates a replacement while other callers reuse the previous value.",
      "asOf": "2026-11-17"
    },
    "F83": {
      "label": "strengths lead, dogpile.cache",
      "display": "Offers a file-backed backend",
      "asOf": "2026-11-17"
    },
    "F84": {
      "label": "strengths, dogpile.cache",
      "display": "Use the included DBM backend for persistent file storage.",
      "asOf": "2026-11-17"
    },
    "F85": {
      "label": "limitations lead, dogpile.cache",
      "display": "Memory backend grows without bounds",
      "asOf": "2026-11-17"
    },
    "F86": {
      "label": "limitations, dogpile.cache",
      "display": "Select a bounded backend when retained cache values need a size limit.",
      "asOf": "2026-11-17"
    },
    "F87": {
      "label": "limitations lead, dogpile.cache",
      "display": "Memory backend retains expired entries",
      "asOf": "2026-11-17"
    },
    "F88": {
      "label": "limitations, dogpile.cache",
      "display": "Expired values stay allocated until they are explicitly removed.",
      "asOf": "2026-11-17"
    },
    "F89": {
      "label": "Quickstart, dogpile.cache",
      "display": "from dogpile.cache import make_region\n\nregion = make_region().configure(\n    'dogpile.cache.memory'\n)\n\n\n@region.cache_on_arguments(namespace=\"foo\")\ndef one(a, b):\n    return a + b\n\n",
      "asOf": "2026-11-17"
    },
    "F90": {
      "label": "Project function, dogpile.cache",
      "display": "def _do_orm_execute(self, orm_context):\n    for opt in orm_context.user_defined_options:\n        if isinstance(opt, RelationshipCache):\n            opt = opt._process_orm_context(orm_context)\n            if opt is None:\n                continue\n\n        if isinstance(opt, FromCache):\n            dogpile_region = self.cache_regions[opt.region]\n\n            our_cache_key = opt._generate_cache_key(\n                orm_context.statement, orm_context.parameters or {}, self\n            )\n\n            if opt.ignore_expiration:\n                cached_value = dogpile_region.get(\n                    our_cache_key,\n                    expiration_time=opt.expiration_time,\n                    ignore_expiration=opt.ignore_expiration,\n                )\n            else:\n\n                def createfunc():\n                    return orm_context.invoke_statement().freeze()\n\n                cached_value = dogpile_region.get_or_create(\n                    our_cache_key,\n                    createfunc,\n                    expiration_time=opt.expiration_time,\n                )\n\n            if cached_value is NO_VALUE:\n                # keyerror?   this is bigger than a keyerror...\n                raise KeyError()\n\n            orm_result = loading.merge_frozen_result(\n                orm_context.session,\n                orm_context.statement,\n                cached_value,\n                load=False,\n            )\n            return orm_result()\n\n    else:\n        return None\n",
      "asOf": "2026-11-17"
    },
    "F91": {
      "label": "Project function reference, dogpile.cache",
      "display": "caching_query.py · _do_orm_execute()",
      "asOf": "2026-11-17"
    },
    "F92": {
      "label": "Project repository, dogpile.cache",
      "display": "sqlalchemy/sqlalchemy",
      "asOf": "2026-11-17"
    },
    "F93": {
      "label": "Project stars, sqlalchemy/sqlalchemy",
      "display": "12.3K",
      "asOf": "2026-11-17"
    },
    "F94": {
      "label": "Project push date, sqlalchemy/sqlalchemy",
      "display": "Nov 2026",
      "asOf": "2026-11-15"
    },
    "F95": {
      "label": "Developer need",
      "display": "Bounded in-memory values",
      "asOf": "2026-11-17"
    },
    "F96": {
      "label": "Why choose cachetools",
      "display": "a cache mapping with an explicit size budget",
      "asOf": "2026-11-17"
    },
    "F97": {
      "label": "Developer need in introduction",
      "display": "bounded in-memory values",
      "asOf": "2026-11-17"
    },
    "F98": {
      "label": "When to consider diskcache",
      "display": "a cache must be shared across local processes",
      "asOf": "2026-11-17"
    },
    "F99": {
      "label": "Developer need",
      "display": "Multiple local processes",
      "asOf": "2026-11-17"
    },
    "F100": {
      "label": "Why choose diskcache",
      "display": "sharing a disk-backed cache directory",
      "asOf": "2026-11-17"
    },
    "F101": {
      "label": "Developer need in introduction",
      "display": "multiple local processes",
      "asOf": "2026-11-17"
    },
    "F102": {
      "label": "Developer need",
      "display": "Reusable computation results",
      "asOf": "2026-11-17"
    },
    "F103": {
      "label": "Why choose joblib",
      "display": "caching function results on the filesystem",
      "asOf": "2026-11-17"
    },
    "F104": {
      "label": "Developer need in introduction",
      "display": "reusable computation results",
      "asOf": "2026-11-17"
    },
    "F105": {
      "label": "When to consider dogpile.cache",
      "display": "coordinated creation and backend selection matter",
      "asOf": "2026-11-17"
    },
    "F106": {
      "label": "Developer need",
      "display": "Coordinated cache refreshes",
      "asOf": "2026-11-17"
    },
    "F107": {
      "label": "Why choose dogpile.cache",
      "display": "one thread refreshing a value while other callers reuse the previous value",
      "asOf": "2026-11-17"
    },
    "F108": {
      "label": "Developer need in introduction",
      "display": "coordinated cache refreshes",
      "asOf": "2026-11-17"
    },
    "F109": {
      "label": "Page introduction",
      "display": "Python caching libraries let application developers reuse stored results instead of repeating work.",
      "asOf": "2026-11-17"
    },
    "F110": {
      "label": "FAQ: Which Python caching library should I choose?",
      "display": "cachetools supplies fixed-size cache mappings.",
      "asOf": "2026-11-17"
    },
    "F111": {
      "label": "FAQ: Which Python caching library should I choose?",
      "display": "DiskCache can share a directory between processes.",
      "asOf": "2026-11-17"
    },
    "F112": {
      "label": "FAQ: Which Python caching library should I choose?",
      "display": "joblib stores function results on the filesystem.",
      "asOf": "2026-11-17"
    },
    "F113": {
      "label": "FAQ: Which Python caching library should I choose?",
      "display": "dogpile.cache coordinates value creation through its locking layer.",
      "asOf": "2026-11-17"
    },
    "F114": {
      "label": "FAQ: Are cachetools caches safe to share across threads?",
      "display": "Shared cache instances need synchronization, such as a suitable lock.",
      "asOf": "2026-11-17"
    },
    "F115": {
      "label": "FAQ: Does an expired cachetools entry immediately release memory?",
      "display": "Expired entries are removed lazily; expire explicitly removes entries whose time-to-live has elapsed.",
      "asOf": "2026-11-17"
    },
    "F116": {
      "label": "FAQ: Can cachetools persist values to disk?",
      "display": "The separately installed shelved-cache helper adds persistence.",
      "asOf": "2026-11-17"
    },
    "F117": {
      "label": "FAQ: Can DiskCache be shared by multiple processes?",
      "display": "Multiple cache objects can reference the same directory from separate processes.",
      "asOf": "2026-11-17"
    },
    "F118": {
      "label": "FAQ: What happens if DiskCache automatic culling is disabled?",
      "display": "Schedule regular cull calls when automatic culling is disabled.",
      "asOf": "2026-11-17"
    },
    "F119": {
      "label": "FAQ: How does joblib enforce a cache size budget?",
      "display": "Call Memory.reduce_size to remove elements until the cache fits its requested limits.",
      "asOf": "2026-11-17"
    },
    "F120": {
      "label": "FAQ: How does joblib enforce a cache size budget?",
      "display": "Cache size is unlimited by default.",
      "asOf": "2026-11-17"
    },
    "F121": {
      "label": "FAQ: Can joblib results expire after a duration?",
      "display": "expires_after supplies a validation callback that forces recomputation after a duration.",
      "asOf": "2026-11-17"
    },
    "F122": {
      "label": "FAQ: Does the dogpile.cache memory backend bound retained values?",
      "display": "The memory backend has no size management and retains values until removed.",
      "asOf": "2026-11-17"
    },
    "F123": {
      "label": "FAQ: Does dogpile.cache expiration delete memory-backend entries?",
      "display": "Expiration uses timestamps and does not remove memory-backend entries.",
      "asOf": "2026-11-17"
    },
    "F124": {
      "label": "Library name, cachetools",
      "display": "cachetools",
      "asOf": "2026-11-20"
    },
    "F125": {
      "label": "Monthly downloads, cachetools",
      "display": "280.0M",
      "asOf": "2026-11-20"
    },
    "F126": {
      "label": "License, cachetools",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F127": {
      "label": "Package release, cachetools",
      "display": "8.0.2",
      "asOf": "2026-11-20"
    },
    "F128": {
      "label": "Package release date, cachetools",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F129": {
      "label": "Install, cachetools",
      "display": "python3.13 -m pip install cachetools==8.0.2",
      "asOf": "2026-11-20"
    },
    "F130": {
      "label": "Quickstart, cachetools",
      "display": "from cachetools import TTLCache\n\ncache = TTLCache(maxsize=128, ttl=60)\ncache[\"answer\"] = 42\nprint(cache[\"answer\"])\n",
      "asOf": "2026-11-20"
    },
    "F131": {
      "label": "Separate cache server required, cachetools",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F132": {
      "label": "Local disk cache backend, cachetools",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F133": {
      "label": "Native caching model, cachetools",
      "display": "Bounded process-local mappings and memoization decorators with TTL and configurable eviction; shared access requires application synchronization.",
      "asOf": "2026-11-20"
    },
    "F134": {
      "label": "Project function, cachetools",
      "display": "def __init__(self, persist_storage: CacheStorage, context: CacheStorageContext):\n    self.function_key = context.function_key\n    self.function_display_name = context.function_display_name\n    self._ttl_seconds = context.ttl_seconds\n    self._max_entries = context.max_entries\n    self._mem_cache: TTLCache[str, bytes] = TTLCache(\n        maxsize=self.max_entries,\n        ttl=self.ttl_seconds,\n        timer=cache_utils.TTLCACHE_TIMER,\n    )\n    self._mem_cache_lock = threading.Lock()\n    self._persist_storage = persist_storage",
      "asOf": "2026-11-20"
    },
    "F135": {
      "label": "Project source file, cachetools",
      "display": "lib/streamlit/runtime/caching/storage/in_memory_cache_storage_wrapper.py",
      "asOf": "2026-11-20"
    },
    "F136": {
      "label": "Project full_name, cachetools",
      "display": "streamlit/streamlit",
      "asOf": "2026-11-20"
    },
    "F137": {
      "label": "Project stargazers_count, cachetools",
      "display": "46.4K",
      "asOf": "2026-11-20"
    },
    "F138": {
      "label": "Library name, redis",
      "display": "redis-py",
      "asOf": "2026-11-20"
    },
    "F139": {
      "label": "Monthly downloads, redis",
      "display": "249.6M",
      "asOf": "2026-11-20"
    },
    "F140": {
      "label": "License, redis",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F141": {
      "label": "Package release, redis",
      "display": "8.1.0",
      "asOf": "2026-11-20"
    },
    "F142": {
      "label": "Package release date, redis",
      "display": "Jul 2026",
      "asOf": "2026-11-20"
    },
    "F143": {
      "label": "Install, redis",
      "display": "python3.13 -m pip install redis==8.1.0",
      "asOf": "2026-11-20"
    },
    "F144": {
      "label": "Quickstart, redis",
      "display": "import redis\n\nclient = redis.Redis(host=\"localhost\", port=6379, decode_responses=True)\nclient.set(\"answer\", \"42\")\n",
      "asOf": "2026-11-20"
    },
    "F145": {
      "label": "Official description, redis",
      "display": "Provides the Python client for the Redis database and key-value store.",
      "asOf": "2026-11-20"
    },
    "F146": {
      "label": "Quickstart source file, redis",
      "display": "commands.html",
      "asOf": "2026-11-20"
    },
    "F147": {
      "label": "Separate cache server required, redis",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F148": {
      "label": "Local disk cache backend, redis",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F149": {
      "label": "Native caching model, redis",
      "display": "Cache shared across application processes/hosts through a separate Redis server and native expiry commands; the Python package is the client.",
      "asOf": "2026-11-20"
    },
    "F150": {
      "label": "Project function, redis",
      "display": "def add(self, key, value, timeout):\n    client = self.get_client(key, write=True)\n    value = self._serializer.dumps(value)\n\n    if timeout == 0:\n        if ret := bool(client.set(key, value, nx=True)):\n            client.delete(key)\n        return ret\n    else:\n        return bool(client.set(key, value, ex=timeout, nx=True))",
      "asOf": "2026-11-20"
    },
    "F151": {
      "label": "Project source file, redis",
      "display": "django/core/cache/backends/redis.py",
      "asOf": "2026-11-20"
    },
    "F152": {
      "label": "Project full_name, redis",
      "display": "django/django",
      "asOf": "2026-11-20"
    },
    "F153": {
      "label": "Project stargazers_count, redis",
      "display": "91.8K",
      "asOf": "2026-11-20"
    },
    "F154": {
      "label": "Library name, joblib",
      "display": "Joblib",
      "asOf": "2026-11-20"
    },
    "F155": {
      "label": "Monthly downloads, joblib",
      "display": "200.3M",
      "asOf": "2026-11-20"
    },
    "F156": {
      "label": "License, joblib",
      "display": "BSD-3-Clause",
      "asOf": "2026-11-20"
    },
    "F157": {
      "label": "Package release, joblib",
      "display": "1.6.0",
      "asOf": "2026-11-20"
    },
    "F158": {
      "label": "Package release date, joblib",
      "display": "Aug 2026",
      "asOf": "2026-11-20"
    },
    "F159": {
      "label": "Install, joblib",
      "display": "python3.13 -m pip install joblib==1.6.0",
      "asOf": "2026-11-20"
    },
    "F160": {
      "label": "Quickstart, joblib",
      "display": "from joblib import Memory\n\nmemory = Memory(\"./cache\", verbose=0)\n\n@memory.cache\ndef square(value):\n    return value * value\n\nsquare(2)\n",
      "asOf": "2026-11-20"
    },
    "F161": {
      "label": "Separate cache server required, joblib",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F162": {
      "label": "Local disk cache backend, joblib",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F163": {
      "label": "Native caching model, joblib",
      "display": "Persist expensive Python function outputs on local disk using Memory and callable wrappers, especially NumPy-oriented compute pipelines.",
      "asOf": "2026-11-20"
    },
    "F164": {
      "label": "Project function, joblib",
      "display": "def _fit(self, X, y=None, routed_params=None, raw_params=None):\n    self.steps = list(self.steps)\n    self._validate_steps()\n    # Setup the memory\n    memory = check_memory(self.memory)\n\n    fit_transform_one_cached = memory.cache(_fit_transform_one)\n    fit_resample_one_cached = memory.cache(_fit_resample_one)\n\n    for step_idx, name, transformer in self._iter(\n        with_final=False, filter_passthrough=False, filter_resample=False\n    ):\n        if transformer is None or transformer == \"passthrough\":\n            with _print_elapsed_time(\"Pipeline\", self._log_message(step_idx)):\n                continue\n\n        if hasattr(memory, \"location\") and memory.location is None:\n            # we do not clone when caching is disabled to\n            # preserve backward compatibility\n            cloned_transformer = transformer\n        else:\n            cloned_transformer = clone(transformer)\n\n        # Fit or load from cache the current transformer\n        step_params = self._get_metadata_for_step(\n            step_idx=step_idx,\n            step_params=routed_params[name],\n            all_params=raw_params,\n        )\n        if hasattr(cloned_transformer, \"transform\") or hasattr(\n            cloned_transformer, \"fit_transform\"\n        ):\n            X, fitted_transformer = fit_transform_one_cached(\n                cloned_transformer,\n                X,\n                y,\n                weight=None,\n                message_clsname=\"Pipeline\",\n                message=self._log_message(step_idx),\n                params=step_params,\n            )\n        elif hasattr(cloned_transformer, \"fit_resample\"):\n            X, y, fitted_transformer = fit_resample_one_cached(\n                cloned_transformer,\n                X,\n                y,\n                message_clsname=\"Pipeline\",\n                message=self._log_message(step_idx),\n                params=routed_params[name],\n            )\n        # Replace the transformer of the step with the fitted\n        # transformer. This is necessary when loading the transformer\n        # from the cache.\n        self.steps[step_idx] = (name, fitted_transformer)\n    return X, y",
      "asOf": "2026-11-20"
    },
    "F165": {
      "label": "Project source file, joblib",
      "display": "imblearn/pipeline.py",
      "asOf": "2026-11-20"
    },
    "F166": {
      "label": "Project full_name, joblib",
      "display": "scikit-learn-contrib/imbalanced-learn",
      "asOf": "2026-11-20"
    },
    "F167": {
      "label": "Project stargazers_count, joblib",
      "display": "7.1K",
      "asOf": "2026-11-20"
    },
    "F168": {
      "label": "Library name, CacheControl",
      "display": "CacheControl",
      "asOf": "2026-11-20"
    },
    "F169": {
      "label": "Monthly downloads, CacheControl",
      "display": "106.6M",
      "asOf": "2026-11-20"
    },
    "F170": {
      "label": "License, CacheControl",
      "display": "Apache-2.0",
      "asOf": "2026-11-20"
    },
    "F171": {
      "label": "Package release, CacheControl",
      "display": "0.15.0",
      "asOf": "2026-11-20"
    },
    "F172": {
      "label": "Package release date, CacheControl",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F173": {
      "label": "Install, CacheControl",
      "display": "python3.13 -m pip install CacheControl==0.15.0",
      "asOf": "2026-11-20"
    },
    "F174": {
      "label": "Quickstart, CacheControl",
      "display": "import requests\nfrom cachecontrol import CacheControl\n\nsession = CacheControl(requests.session())\nresponse = session.get(\"https://example.com\")\n",
      "asOf": "2026-11-20"
    },
    "F175": {
      "label": "Official description, CacheControl",
      "display": "Adds HTTP caching to requests sessions.",
      "asOf": "2026-11-20"
    },
    "F176": {
      "label": "Quickstart source file, CacheControl",
      "display": "README.rst",
      "asOf": "2026-11-20"
    },
    "F177": {
      "label": "Separate cache server required, CacheControl",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F178": {
      "label": "Local disk cache backend, CacheControl",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F179": {
      "label": "Native caching model, CacheControl",
      "display": "Requests-session HTTP response caching governed by HTTP cache headers, with dictionary or optional file-backed storage; not arbitrary function-result caching.",
      "asOf": "2026-11-20"
    },
    "F180": {
      "label": "Project function, CacheControl",
      "display": "def create_session(self) -> requests.Session:\n    session = requests.Session()\n    session.headers[\"User-Agent\"] = self._user_agent\n\n    if self._cache_control is None:\n        return session\n\n    adapter = CacheControlAdapter(\n        cache=self._cache_control,\n        pool_maxsize=self._pool_size,\n    )\n    session.mount(\"http://\", adapter)\n    session.mount(\"https://\", adapter)\n\n    return session",
      "asOf": "2026-11-20"
    },
    "F181": {
      "label": "Project source file, CacheControl",
      "display": "src/poetry/utils/authenticator.py",
      "asOf": "2026-11-20"
    },
    "F182": {
      "label": "Project full_name, CacheControl",
      "display": "python-poetry/poetry",
      "asOf": "2026-11-20"
    },
    "F183": {
      "label": "Project stargazers_count, CacheControl",
      "display": "34.3K",
      "asOf": "2026-11-20"
    },
    "F184": {
      "label": "Library name, async-lru",
      "display": "async-lru",
      "asOf": "2026-11-20"
    },
    "F185": {
      "label": "Monthly downloads, async-lru",
      "display": "45.0M",
      "asOf": "2026-11-20"
    },
    "F186": {
      "label": "License, async-lru",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F187": {
      "label": "Package release, async-lru",
      "display": "2.4.0",
      "asOf": "2026-11-20"
    },
    "F188": {
      "label": "Package release date, async-lru",
      "display": "Oct 2026",
      "asOf": "2026-11-20"
    },
    "F189": {
      "label": "Install, async-lru",
      "display": "python3.13 -m pip install async-lru==2.4.0",
      "asOf": "2026-11-20"
    },
    "F190": {
      "label": "Quickstart, async-lru",
      "display": "import asyncio\nfrom async_lru import alru_cache\n\n@alru_cache(maxsize=32)\nasync def double(value):\n    return value * 2\n\nasyncio.run(double(2))\n",
      "asOf": "2026-11-20"
    },
    "F191": {
      "label": "Official description, async-lru",
      "display": "Provides an LRU cache for asyncio.",
      "asOf": "2026-11-20"
    },
    "F192": {
      "label": "Quickstart source file, async-lru",
      "display": "README.rst",
      "asOf": "2026-11-20"
    },
    "F193": {
      "label": "Separate cache server required, async-lru",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F194": {
      "label": "Local disk cache backend, async-lru",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F195": {
      "label": "Native caching model, async-lru",
      "display": "Memoize awaited asyncio function results and coalesce concurrent calls for the same key, with explicit cache lifecycle methods.",
      "asOf": "2026-11-20"
    },
    "F196": {
      "label": "Project function, async-lru",
      "display": "@alru_cache(ttl=30)\nasync def _get_setting_cached_by_org(\n    key: str,\n    organization_id: OrganizationID | None,\n    default: Any | None = None,\n) -> Any | None:\n    \"\"\"Internal cached implementation keyed by (key, organization_id).\n\n    This ensures different organizations have isolated cache entries.\n    \"\"\"\n    logger.debug(\"Cache miss\", key=key, organization_id=organization_id)\n    role = ctx_role.get()\n    sess = ctx_session.get(None)\n    return await get_setting(key, role=role, session=sess, default=default)",
      "asOf": "2026-11-20"
    },
    "F197": {
      "label": "Project source file, async-lru",
      "display": "tracecat/settings/service.py",
      "asOf": "2026-11-20"
    },
    "F198": {
      "label": "Project full_name, async-lru",
      "display": "TracecatHQ/tracecat",
      "asOf": "2026-11-20"
    },
    "F199": {
      "label": "Project stargazers_count, async-lru",
      "display": "3.9K",
      "asOf": "2026-11-20"
    },
    "F200": {
      "label": "Project function, async-lru",
      "display": "def _configure_package_metadata_cache(self, _change: object = None) -> None:\n    self._fetch_package_metadata = cast(\n        \"FetchPackageMetadata\",\n        alru_cache(maxsize=self.package_metadata_cache_size)(\n            partial(_fetch_package_metadata, self._httpx_client)\n        ),\n    )\n    self._package_metadata_cache_expires = monotonic() + self.cache_timeout",
      "asOf": "2026-11-20"
    },
    "F201": {
      "label": "Project source file, async-lru",
      "display": "jupyterlab/extensions/pypi.py",
      "asOf": "2026-11-20"
    },
    "F202": {
      "label": "Project full_name, async-lru",
      "display": "jupyterlab/jupyterlab",
      "asOf": "2026-11-20"
    },
    "F203": {
      "label": "Project stargazers_count, async-lru",
      "display": "15.4K",
      "asOf": "2026-11-20"
    },
    "F204": {
      "label": "Library name, boltons",
      "display": "boltons",
      "asOf": "2026-11-20"
    },
    "F205": {
      "label": "Monthly downloads, boltons",
      "display": "30.7M",
      "asOf": "2026-11-20"
    },
    "F206": {
      "label": "License, boltons",
      "display": "BSD-3-Clause",
      "asOf": "2026-11-20"
    },
    "F207": {
      "label": "Package release, boltons",
      "display": "26.2.0",
      "asOf": "2026-11-20"
    },
    "F208": {
      "label": "Package release date, boltons",
      "display": "Sep 2026",
      "asOf": "2026-11-20"
    },
    "F209": {
      "label": "Install, boltons",
      "display": "python3.13 -m pip install boltons==26.2.0",
      "asOf": "2026-11-20"
    },
    "F210": {
      "label": "Quickstart, boltons",
      "display": "from boltons.cacheutils import LRU\n\ncache = LRU(max_size=128)\ncache[\"answer\"] = 42\nprint(cache[\"answer\"])\n",
      "asOf": "2026-11-20"
    },
    "F211": {
      "label": "Official description, boltons",
      "display": "Provides utilities that complement Python builtins.",
      "asOf": "2026-11-20"
    },
    "F212": {
      "label": "Quickstart source file, boltons",
      "display": "cacheutils.html",
      "asOf": "2026-11-20"
    },
    "F213": {
      "label": "Separate cache server required, boltons",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F214": {
      "label": "Local disk cache backend, boltons",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F215": {
      "label": "Native caching model, boltons",
      "display": "LRU/LRI dictionary-like caches and lazy on_miss loaders inside a broader Python utility suite; suite downloads do not measure cacheutils adoption.",
      "asOf": "2026-11-20"
    },
    "F216": {
      "label": "Project function, boltons",
      "display": "def _thread_push_device(device_mapper, caches, device, props,\n                        role_id, site_id):\n    device_type = props.pop(\"model\")\n    platform = props.pop(\"platform\", None)\n\n    name = str(device)\n    try:\n        device = next(device_mapper.get(name=name.lower()))\n    except StopIteration:\n        device = device_mapper.post(\n            name=name, slug=name.lower(),\n            device_type=caches[\"device_types\"][device_type.lower()],\n            device_role=role_id, site=site_id,\n        )\n\n    update_netbox_obj_from(device, props)\n    if platform:\n        device.platform = caches[\"platforms\"][platform.lower()]\n    device.put()",
      "asOf": "2026-11-20"
    },
    "F217": {
      "label": "Project source file, boltons",
      "display": "tools/push_devices.py",
      "asOf": "2026-11-20"
    },
    "F218": {
      "label": "Project full_name, boltons",
      "display": "scaleway/netbox-netprod-importer",
      "asOf": "2026-11-20"
    },
    "F219": {
      "label": "Project stargazers_count, boltons",
      "display": "109",
      "asOf": "2026-11-20"
    },
    "F220": {
      "label": "Library name, diskcache",
      "display": "diskcache",
      "asOf": "2026-11-20"
    },
    "F221": {
      "label": "Monthly downloads, diskcache",
      "display": "26.6M",
      "asOf": "2026-11-20"
    },
    "F222": {
      "label": "License, diskcache",
      "display": "Apache-2.0",
      "asOf": "2026-11-20"
    },
    "F223": {
      "label": "Package release, diskcache",
      "display": "5.6.3",
      "asOf": "2026-11-20"
    },
    "F224": {
      "label": "Package release date, diskcache",
      "display": "Aug 2023",
      "asOf": "2026-11-20"
    },
    "F225": {
      "label": "Install, diskcache",
      "display": "python3.13 -m pip install diskcache==5.6.3",
      "asOf": "2026-11-20"
    },
    "F226": {
      "label": "Quickstart, diskcache",
      "display": "from diskcache import Cache\n\nwith Cache(\"./cache\") as cache:\n    cache.set(\"answer\", 42)\n",
      "asOf": "2026-11-20"
    },
    "F227": {
      "label": "Separate cache server required, diskcache",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F228": {
      "label": "Local disk cache backend, diskcache",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F229": {
      "label": "Native caching model, diskcache",
      "display": "Persistent local disk/SQLite cache with process-safe cache primitives and selectable eviction; native synchronous API.",
      "asOf": "2026-11-20"
    },
    "F230": {
      "label": "Project function, diskcache",
      "display": "@functools.lru_cache(1)\ndef get_cache():\n    \"\"\"Get the context object that contains previously-computed return values.\n\n    The cache is used to avoid unnecessary computations and API calls, which can\n    be long and expensive for large models.\n\n    The cache directory defaults to `HOMEDIR/.cache/outlines`, but this choice\n    can be overridden by the user by setting the value of the `OUTLINES_CACHE_DIR`\n    environment variable.\n\n    \"\"\"\n    from outlines._version import __version__ as outlines_version  # type: ignore\n\n    outlines_cache_dir = os.environ.get(\"OUTLINES_CACHE_DIR\")\n    xdg_cache_home = os.environ.get(\"XDG_CACHE_HOME\")\n    home_dir = os.path.normpath(os.path.expanduser(\"~\"))\n    if outlines_cache_dir:\n        # OUTLINES_CACHE_DIR takes precedence\n        cache_dir = outlines_cache_dir\n    elif xdg_cache_home:  # pragma: no cover\n        cache_dir = os.path.join(xdg_cache_home, \"outlines\")\n    elif home_dir != \"/\": # pragma: no cover\n        cache_dir = os.path.join(home_dir, \".cache\", \"outlines\")\n    else:  # pragma: no cover\n        # home_dir may be / inside a docker container without existing user\n        tempdir = tempfile.gettempdir()\n        cache_dir = os.path.join(tempdir, \".cache\", \"outlines\")\n\n    memory = Cache(\n        cache_dir,\n        eviction_policy=\"none\",\n        cull_limit=0,\n        disk=CloudpickleDisk,\n    )\n\n    # ensure if version upgrade occurs, old cache is pruned\n    if outlines_version != memory.get(\"__version__\"):\n        memory.clear()\n    memory[\"__version__\"] = outlines_version\n\n    return memory",
      "asOf": "2026-11-20"
    },
    "F231": {
      "label": "Project source file, diskcache",
      "display": "src/outlines/caching.py",
      "asOf": "2026-11-20"
    },
    "F232": {
      "label": "Project full_name, diskcache",
      "display": "dottxt-ai/outlines",
      "asOf": "2026-11-20"
    },
    "F233": {
      "label": "Project stargazers_count, diskcache",
      "display": "16.0K",
      "asOf": "2026-11-20"
    },
    "F234": {
      "label": "Library name, cachebox",
      "display": "cachebox",
      "asOf": "2026-11-20"
    },
    "F235": {
      "label": "Monthly downloads, cachebox",
      "display": "14.3M",
      "asOf": "2026-11-20"
    },
    "F236": {
      "label": "License, cachebox",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F237": {
      "label": "Package release, cachebox",
      "display": "6.2.10",
      "asOf": "2026-11-20"
    },
    "F238": {
      "label": "Package release date, cachebox",
      "display": "Oct 2026",
      "asOf": "2026-11-20"
    },
    "F239": {
      "label": "Install, cachebox",
      "display": "python3.13 -m pip install cachebox==6.2.10",
      "asOf": "2026-11-20"
    },
    "F240": {
      "label": "Quickstart, cachebox",
      "display": "import cachebox\n\ncache = cachebox.LRUCache(maxsize=128)\ncache[\"answer\"] = 42\nprint(cache[\"answer\"])\n",
      "asOf": "2026-11-20"
    },
    "F241": {
      "label": "Official description, cachebox",
      "display": "Provides memoizing caches written in Rust.",
      "asOf": "2026-11-20"
    },
    "F242": {
      "label": "Quickstart source file, cachebox",
      "display": "getting-started/",
      "asOf": "2026-11-20"
    },
    "F243": {
      "label": "Separate cache server required, cachebox",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F244": {
      "label": "Local disk cache backend, cachebox",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F245": {
      "label": "Native caching model, cachebox",
      "display": "Rust-backed process-local cache policies with Python mappings, event callbacks, and sync/async decorators; v6 container-copy semantics matter.",
      "asOf": "2026-11-20"
    }
  },
  "dataCheckedAt": "2026-11-20",
  "agent": {
    "exaCall": {
      "endpoint": "/search",
      "body": {
        "query": "Best Python caching libraries cachetools DiskCache joblib dogpile.cache examples",
        "numResults": 5
      },
      "docsUrl": "https://exa.ai/docs/reference/search"
    },
    "calls": []
  }
}
