SchemaLoader

atmosphere.SchemaLoader(client)

Loads PackableSample schemas from ATProto.

This class fetches schema records from ATProto and can list available schemas from a repository.

Examples

>>> client = AtmosphereClient()
>>> client.login("handle", "password")
>>>
>>> loader = SchemaLoader(client)
>>> schema = loader.get("at://did:plc:.../ac.foundation.dataset.sampleSchema/...")
>>> print(schema["name"])
'MySample'

Methods

Name Description
get Fetch a schema record by AT URI.
list_all List schema records from a repository.

get

atmosphere.SchemaLoader.get(uri)

Fetch a schema record by AT URI.

Parameters

Name Type Description Default
uri str | AtUri The AT URI of the schema record. required

Returns

Name Type Description
dict The schema record as a dictionary.

Raises

Name Type Description
ValueError If the record is not a schema record.
atproto.exceptions.AtProtocolError If record not found.

list_all

atmosphere.SchemaLoader.list_all(repo=None, limit=100)

List schema records from a repository.

Parameters

Name Type Description Default
repo Optional[str] The DID of the repository. Defaults to authenticated user. None
limit int Maximum number of records to return. 100

Returns

Name Type Description
list[dict] List of schema records.