torchcell.literature.ZoteroConfig

class ZoteroConfig(*, library_id: str, library_type: Literal['group', 'user'] = 'group', api_key: SecretStr)[source]

Bases: BaseModel

Credentials for a single Zotero library.

For the TorchCell group library only two values are needed: the group id and an API key. library_type defaults to "group" – the only mode we use. The key is wrapped in SecretStr so it never leaks into logs or reprs.

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

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

classmethod from_env() → ZoteroConfig[source]

Build credentials from ZOTERO_LIBRARY_ID + ZOTERO_API_KEY.

ZOTERO_LIBRARY_TYPE is honored if set but defaults to "group". Raises KeyError if either required variable is missing – we do not silently degrade to an unauthenticated client.