AioHttpDocumentLoader¶
AioHttpDocumentLoader retrieves JSON-LD documents with aiohttp.
This loader uses asynchronous fetching internally, but JSON-LD processing itself remains synchronous.
The concrete loader class is exported from pyld:
from pyld import AioHttpDocumentLoader, jsonld
jsonld.set_document_loader(AioHttpDocumentLoader(timeout=10))
Use secure=True to require HTTPS URLs:
Extra keyword arguments are forwarded to aiohttp request calls:
from pyld import AioHttpDocumentLoader, jsonld
loader = AioHttpDocumentLoader(timeout=10)
jsonld.set_document_loader(loader)
Install the optional dependency with: