CAR reader

The CAR format (Content Addressable aRchives) can be used to store content addressable objects in the form of IPLD block data as a sequence of bytes; typically in a file with a .car filename extension.

The CAR format is intended as a serialized representation of any IPLD DAG (graph) as the concatenation of its blocks, plus a header that describes the graphs in the file (via root CIDs). The requirement for the blocks in a CAR to form coherent DAGs is not strict, so the CAR format may also be used to store arbitrary IPLD blocks.

Specification for v1:

class 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.


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


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

data – Content of the CAR file.


Parsed CAR file.

Return type:


property root: CID

Get root.