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 SQLite HTTP caching for JSON-LD contexts with
requests-cache. -
: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-code-braces:{ .lg .middle } Custom Document Loaders
Subclass
DocumentLoaderfor application-specific loading logic.
The default document loader is selected at import time. PyLD uses
RequestsDocumentLoader if requests is available, falls back to
AioHttpDocumentLoader if aiohttp is available, and otherwise installs a
dummy loader that raises when invoked.