CID Module

class ipfs_dict_chain.CID.CID(value: str)[source]

Bases: object

A class representing a Content Identifier (CID) in the IPFS network.

Parameters:

value – The CID value as a string.

CID_REGEX = re.compile('^(/ipfs/)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]+$')
__eq__(other: Any) bool[source]

Return True if the other object is a CID with the same value, False otherwise.

__hash__() int[source]

Return the hash value of the CID object.

__ne__(other: Any) bool[source]

Return True if the other object is not a CID or has a different value, False otherwise.

__repr__() str[source]

Return a more informative representation of the CID object.

__str__() str[source]

Return the string representation of the CID object.

long() str[source]

Return the long version of the CID value.

Returns:

The long CID value as a string.

short() str[source]

Return the short version of the CID value.

Returns:

The short CID value as a string.