Referencing

0.37.0 · active · verified Sat Mar 28

Referencing is a Python library that facilitates JSON referencing, enabling efficient handling of JSON references within Python applications. The current version is 0.37.0, released on March 28, 2026. The library maintains a regular release cadence, with updates addressing compatibility and feature enhancements.

Warnings

Install

Imports

Quickstart

This example demonstrates how to create a registry, define a JSON schema with a reference, register the schema, and retrieve it from the registry.

from referencing import Registry, Resource

# Create a new registry
registry = Registry()

# Define a JSON schema with a reference
schema = {
    "$id": "https://example.com/person.schema.json",
    "type": "object",
    "properties": {
        "name": {"type": "string"},
        "age": {"type": "integer"},
        "address": {"$ref": "https://example.com/address.schema.json"}
    }
}

# Register the schema
resource = Resource.from_contents(schema)
registry.register(resource)

# Retrieve the registered schema
retrieved_schema = registry.contents("https://example.com/person.schema.json")
print(retrieved_schema)

view raw JSON →