Package dexa_sdk
Expand source code
from .logs.core import configure_logger
from pyld import jsonld
# Configure loguru logger
configure_logger()
# To store jsonld context resolved documents
cache = {}
def caching_document_loader(url, options):
"""Simple in-memory cache for JSONLD context resolutions"""
loader = jsonld.requests_document_loader()
if url in cache:
return cache[url]
resp = loader(url)
cache[url] = resp
return resp
jsonld.set_document_loader(caching_document_loader)
Sub-modules
dexa_sdk.agent
dexa_sdk.agreements
dexa_sdk.connections
dexa_sdk.data_controller
dexa_sdk.did_mydata
dexa_sdk.jsonld
dexa_sdk.ledgers
dexa_sdk.logs
dexa_sdk.managers
dexa_sdk.marketplace
dexa_sdk.storage
dexa_sdk.utils
Functions
def caching_document_loader(url, options)
-
Simple in-memory cache for JSONLD context resolutions
Expand source code
def caching_document_loader(url, options): """Simple in-memory cache for JSONLD context resolutions""" loader = jsonld.requests_document_loader() if url in cache: return cache[url] resp = loader(url) cache[url] = resp return resp