Document loaders retrieve remote JSON-LD documents and contexts. PyLD ships
class-based loaders for common cases and supports custom subclasses of
DocumentLoader.
-
:material-cloud-download:{ .lg .middle }
RequestsDocumentLoader
Synchronous remote document loading with
requests. -
:material-database:{ .lg .middle }
SqliteCacheRequestsDocumentLoader
Persistent :simple-sqlite: SQLite caching for remote JSON-LD documents.
-
:material-sync:{ .lg .middle }
AioHttpDocumentLoader
Asynchronous fetching with
aiohttpwhile JSON-LD processing stays synchronous. -
:material-snowflake:{ .lg .middle }
FrozenDocumentLoader
Serve only documents from an allowlist for air-gapped or reproducible runs.
-
:material-file-outline:{ .lg .middle }
FileDocumentLoader
Read local JSON-LD documents from
file:URLs. -
:material-call-split:{ .lg .middle }
SchemeDirectedDocumentLoader
Delegate to another Document Loader based on the scheme of the URL, for instance,
file:vshttps://. -
:material-shape-outline:{ .lg .middle }
TypeDirectedDocumentLoader
Delegate by Python input type, for instance
pathlib.Pathvs URLstr. -
:material-code-braces:{ .lg .middle } Custom Document Loaders
Subclass
DocumentLoaderfor application-specific loading logic.
The default document loader is selected at import time, in this order:
RequestsDocumentLoaderifrequestsis availableAioHttpDocumentLoaderifaiohttpis available
If neither is installed, document loading raises.