AtmosphereIndex
atmosphere.AtmosphereIndex(client, *, data_store=None)
ATProto index implementing AbstractIndex protocol.
Wraps SchemaPublisher/Loader and DatasetPublisher/Loader to provide a unified interface compatible with LocalIndex.
Optionally accepts a PDSBlobStore for writing dataset shards as ATProto blobs, enabling fully decentralized dataset storage.
Examples
>>> client = AtmosphereClient()
>>> client.login("handle.bsky.social", "app-password")
>>>
>>> # Without blob storage (external URLs only)
>>> index = AtmosphereIndex(client)
>>>
>>> # With PDS blob storage
>>> store = PDSBlobStore(client)
>>> index = AtmosphereIndex(client, data_store=store)
>>> entry = index.insert_dataset(dataset, name="my-data")
Attributes
| data_store |
The PDS blob store for writing shards, or None if not configured. |
| datasets |
Lazily iterate over all dataset entries (AbstractIndex protocol). |
| schemas |
Lazily iterate over all schema records (AbstractIndex protocol). |
Methods
decode_schema
atmosphere.AtmosphereIndex.decode_schema(ref)
Reconstruct a Python type from a schema record.
Parameters
| ref |
str |
AT URI of the schema record. |
required |
get_dataset
atmosphere.AtmosphereIndex.get_dataset(ref)
Get a dataset by AT URI.
Parameters
| ref |
str |
AT URI of the dataset record. |
required |
get_schema
atmosphere.AtmosphereIndex.get_schema(ref)
Get a schema record by AT URI.
Parameters
| ref |
str |
AT URI of the schema record. |
required |
Returns
|
dict |
Schema record dictionary. |
insert_dataset
atmosphere.AtmosphereIndex.insert_dataset(
ds,
*,
name,
schema_ref=None,
**kwargs,
)
Insert a dataset into ATProto.
Parameters
| ds |
Dataset |
The Dataset to publish. |
required |
| name |
str |
Human-readable name. |
required |
| schema_ref |
Optional[str] |
Optional schema AT URI. If None, auto-publishes schema. |
None |
| **kwargs |
|
Additional options (description, tags, license). |
{} |
list_datasets
atmosphere.AtmosphereIndex.list_datasets(repo=None)
Get all dataset entries as a materialized list (AbstractIndex protocol).
Parameters
| repo |
Optional[str] |
DID of repository. Defaults to authenticated user. |
None |
list_schemas
atmosphere.AtmosphereIndex.list_schemas(repo=None)
Get all schema records as a materialized list (AbstractIndex protocol).
Parameters
| repo |
Optional[str] |
DID of repository. Defaults to authenticated user. |
None |
Returns
|
list[dict] |
List of schema records as dictionaries. |
publish_schema
atmosphere.AtmosphereIndex.publish_schema(
sample_type,
*,
version='1.0.0',
**kwargs,
)
Publish a schema to ATProto.
Parameters
| sample_type |
Type[Packable] |
A Packable type (PackableSample subclass or @packable-decorated). |
required |
| version |
str |
Semantic version string. |
'1.0.0' |
| **kwargs |
|
Additional options (description, metadata). |
{} |
Returns
|
str |
AT URI of the schema record. |