--- id: pyld version: "3.1.0" license: BSD 3-Clause license license_treatment: permissive maintenance: active --- # PyLD — Python implementation of the JSON-LD API License: permissive · Maintenance: active · Downloads: 358.4K/mo ## What it is and what it does PyLD is a Python library that implements the JSON-LD 1.1 specification and related W3C recommendations for processing Linked Data in JSON. It provides core operations to transform JSON documents: compact (reduce verbosity using a context), expand (make all IRIs explicit), flatten (normalize nested structures), frame (reshape to a template), and normalize (create a canonical form for comparison or hashing). The library depends on cachetools for memoization, frozendict for immutable dictionaries, and lxml for XML processing. The package is designed for applications that need to add semantic meaning to JSON, interoperate with RDF systems, or work with structured data formats like Microformats and Microdata. It includes a FrozenDocumentLoader for air-gapped deployments that prevents remote context fetches, and supports custom document loaders via Requests or aiohttp for production environments. The library aims for W3C spec conformance and is actively maintained. Use it for: - Compact verbose JSON-LD documents using a context to make them more readable and reduce payload size - Expand JSON-LD to explicit form for RDF processing, semantic analysis, or interoperability with linked data systems - Normalize documents to a canonical form for content hashing, deduplication, or cryptographic signing - Frame JSON-LD documents into a specific tree structure for application-specific data models - Validate and process ActivityStreams, Verifiable Credentials, or DID documents using bundled W3C contexts - Build semantic web services that need to handle multiple structured data formats (Microdata, RDFa, Microformats) ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. PyLD is a Python implementation of the JSON-LD specification that transforms, expands, compacts, frames, and normalizes JSON-LD documents according to W3C standards. Yes. PyLD is a mature, actively maintained implementation of a W3C standard with no known vulnerabilities, low install friction, and a permissive license. Install it if you need to process JSON-LD documents, work with linked data, or add semantics to JSON. The FrozenDocumentLoader and optional async support make it suitable for both development and production use. ## Install pip install pyld uv add pyld poetry add pyld ## Installing PyLD Before you install: Low install friction with a pure-wheel distribution. Actively maintained with a recent release; the repository is not archived and has received commits. Three runtime dependencies (cachetools, frozendict, lxml) are all stable, widely-used libraries. License in practice: BSD 3-Clause is a permissive license. You can use, modify, and distribute PyLD with minimal restrictions, provided you include the license notice and disclaimer. Quickstart: pip install PyLD from pyld import jsonld import json doc = {"http://schema.org/name": "Example"} context = {"name": "http://schema.org/name"} compacted = jsonld.compact(doc, context) print(json.dumps(compacted, indent=2)) Verify before relying: - Whether Python 3.10 or later is strictly required (requires_python field is unspecified in the fact sheet) - Performance characteristics and memory footprint for large or deeply nested documents - Whether remote context fetching is enabled by default and what security implications that carries ## Package facts - License: BSD 3-Clause license (permissive) - Python support: unspecified - Install friction: low - Maintenance: active - Downloads: 358.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags json-ld processor python, linked data json transformation, json-ld compact expand frame, rdf dataset canonicalization, semantic json processing, json-ld w3c implementation, linked data context resolution, linked-data, semantic-web, w3c-standard [View on SkillFed](https://skillfed.io/packages/pyld) · [View on PyPI](https://pypi.org/project/pyld/)