local.LocalDatasetEntry

local.LocalDatasetEntry(
    name,
    schema_ref,
    data_urls,
    metadata=None,
    _cid=None,
    _legacy_uuid=None,
)

Index entry for a dataset stored in the local repository.

Implements the IndexEntry protocol for compatibility with AbstractIndex. Uses dual identity: a content-addressable CID (ATProto-compatible) and a human-readable name.

The CID is generated from the entry’s content (schema_ref + data_urls), ensuring the same data produces the same CID whether stored locally or in the atmosphere. This enables seamless promotion from local to ATProto.

Attributes

Name Type Description
name str Human-readable name for this dataset.
schema_ref str Reference to the schema for this dataset.
data_urls list[str] WebDataset URLs for the data.
metadata dict | None Arbitrary metadata dictionary, or None if not set.

Methods

Name Description
from_redis Load an entry from Redis by CID.
write_to Persist this index entry to Redis.

from_redis

local.LocalDatasetEntry.from_redis(redis, cid)

Load an entry from Redis by CID.

Parameters

Name Type Description Default
redis Redis Redis connection to read from. required
cid str Content identifier of the entry to load. required

Returns

Name Type Description
LocalDatasetEntry LocalDatasetEntry loaded from Redis.

Raises

Name Type Description
KeyError If entry not found.

write_to

local.LocalDatasetEntry.write_to(redis)

Persist this index entry to Redis.

Stores the entry as a Redis hash with key ‘{REDIS_KEY_DATASET_ENTRY}:{cid}’.

Parameters

Name Type Description Default
redis Redis Redis connection to write to. required