flpq_data.dataset.graph_dir#
- graph_dir(name: str, verify: bool = False) Path[source]#
Return the local directory of a graph, downloading it on a cache miss.
The data lives in the machine-global cache (see
cache_root()), mirroring the dataset layout:<root>/<version>/graph/<name>/<name>.tar.gz plus the unpacked contents in the same folder
A cache hit — the folder and archive are present and the digest matches the registry — returns the path with zero network. The digest is read from the
<name>.tar.gz.sha256sidecar written at install;verify=Truere-hashes the archive instead of trusting the sidecar. On a miss the archive is downloaded, its sha256 is verified against the registry while streaming, it is unpacked (a single top-level directory is required), and the result is moved into the cache; any failure leaves the cache untouched.- Parameters:
- namestr
The name of the graph from the dataset.
- verifybool, optional
Re-hash the cached archive against the registry instead of trusting the sidecar digest (default
False).
- Returns:
- pathPath
Path to the directory with the graph data.
- Raises:
- FileNotFoundError
If no graph with this name exists in the dataset.
Examples
>>> from flpq_data import * >>> path = graph_dir("generations") >>> path.name 'generations'