squid_py.did module

DID Lib to do DID’s and DDO’s.

class squid_py.did.DID

Bases: object

Class representing an asset DID.

static did()

Create a did.

Format of the did: did:op:cb36cf78d87f4ce4a784f17c2a4a694f19f3fbf05b814ac6b0b7197163888865

Returns

Asset did, str.

squid_py.did.did_parse(did)

Parse a DID into it’s parts.

Parameters

did – Asset did, str.

Returns

Python dictionary with the method and the id.

squid_py.did.did_to_id(did)

Return an id extracted from a DID string.

squid_py.did.did_to_id_bytes(did)

Return an Ocean DID to it’s correspondng hex id in bytes.

So did:op:<hex>, will return <hex> in byte format

squid_py.did.id_to_did(did_id, method='op')

Return an Ocean DID from given a hex id.

squid_py.did.is_did_valid(did)

Did validator.

Return True if the did is a valid DID with the method name ‘op’ and the id in the Ocean format

Parameters

did – Asset did, str

:return bool