torchcell.literature.LiteratureKeys

class LiteratureKeys(*, hashes: dict[str, str])[source]

Bases: ApiKeys

The shared ApiKeys model bound to the TC_LIT_* variables.

classmethod from_pairs(spec: str, env_name: str = 'TC_LIT_API_KEYS') → Self[source]

Parse name1:key1,name2:key2 plaintext pairs, hashing each key.

classmethod from_env() → Self[source]

Load keys from TC_LIT_KEYS_FILE (preferred) or TC_LIT_API_KEYS.

Raises KeyError if neither is set – the server never runs unauthenticated.

model_config: ClassVar[ConfigDict] = {'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].