Weblate Schemas

2025.6 · active · verified Fri Apr 17

A collection of JSON schemas used by Weblate for various objects and APIs. This library provides a programmatic way to access and retrieve these schemas as Python dictionaries, often used in conjunction with the `jsonschema` library for validation. It follows a calendar versioning scheme (YYYY.M) with regular monthly releases.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to list available schemas and retrieve a specific schema using `get_schema`. The schemas are returned as Python dictionaries, ready for use with a JSON schema validator like `jsonschema` (not directly imported here as it's an external dependency for validation, not schema retrieval).

from weblate_schemas import get_schema, list_schemas
import json

# List available schemas
available_schemas = list_schemas()
print(f"Available schemas: {available_schemas[:3]}...")

# Retrieve a specific schema (e.g., component.json)
try:
    component_schema = get_schema('component.json')
    print(f"\nSuccessfully loaded 'component.json' schema. First 100 chars:\n{json.dumps(component_schema, indent=2)[:100]}...")
except KeyError:
    print("\n'component.json' not found. Please check available schemas.")

# Example of how you might use it with jsonschema (requires pip install jsonschema)
# from jsonschema import validate, ValidationError
# data_to_validate = {"name": "My Component", "slug": "my-component"}
# try:
#     validate(instance=data_to_validate, schema=component_schema)
#     print("\nData is valid against 'component.json' schema.")
# except ValidationError as e:
#     print(f"\nData validation failed: {e.message}")

view raw JSON →