atproto_core.car

class atproto_core.car.CAR(root: CID, blocks: Dict[CID, dict])

Bases: object

CAR file.

property blocks: Dict[CID, dict]

Get blocks.

classmethod from_bytes(data: bytes) CAR

Decode CAR file.

Note

You could pass as data response of client.com.atproto.sync.get_repo, for example. And other responses of methods in the sync namespace.

Example

>>> from atproto import CAR, Client
>>> client = Client()
>>> client.login('my-handle', 'my-password')
>>> repo = client.com.atproto.sync.get_repo({'did': client.me.did})
>>> car_file = CAR.from_bytes(repo)
>>> print(car_file.root)
>>> print(car_file.blocks)
Parameters:

data – Content of the CAR file.

Returns:

Parsed CAR file.

Return type:

atproto.CAR

property root: CID

Get root.

Submodules