IPFSDict Module
- class ipfs_dict_chain.IPFSDict.IPFSDict(cid: str | None = None)[source]
Bases:
DictA dictionary-like object that stores its data on IPFS.
- Parameters:
cid (Optional[str], optional) – The IPFS content identifier (CID) of the dictionary data, defaults to None
- __getitem__(key: str) Any[source]
Get the value of the given key in the IPFSDict object.
- Parameters:
key (str) – The key to get the value for
- Returns:
The value of the given key
- Return type:
Any
- __setitem__(key: str, value: Any) None[source]
Set the value of the given key in the IPFSDict object.
- Parameters:
key (str) – The key to set the value for
value (Any) – The value to set
- __str__() str[source]
Convert the IPFSDict object to a string representation.
- Returns:
The string representation of the IPFSDict object
- Return type:
- cid() str[source]
Get the IPFS content identifier (CID) of the dictionary data.
- Returns:
The CID
- Return type:
- items() List[Tuple[str, Any]][source]
Get the dictionary data. This is a list of key-value pairs with all the data except values that start with an underscore.
- Returns:
The dictionary data
- Return type:
List[Tuple[str, Any]]