Skip to main content

Schema Quarry

PyPI Status Python Version License

Documentation Tests Coverage Quality Gate Status

pre-commit Black Ruff Poetry

Features

  • Convert OpenAPI definitions to Parquet schemas
  • Use Schema Quarry as a CLI or as a Python library

Requirements

  • Python 3.12+

Installation

You can install Schema Quarry via pip from PyPI:

pip install schema-quarry

For local development with uv:

uv sync --dev

Usage

CLI:

schema-quarry generate \
  --source "https://petstore3.swagger.io/api/v3/openapi.json" \
  --root-schema Pet \
  --output-file pet.parquet \
  --print-schema

Skattemelding example:

schema-quarry generate \
  --source "https://app.swaggerhub.com/apiproxy/registry/skatteetaten/skattemelding-api/4.2.0" \
  --root-schema Skattemelding \
  --output-file skattemelding.parquet \
  --print-schema

Write directly to Google Cloud Storage:

schema-quarry generate \
  --source "https://app.swaggerhub.com/apiproxy/registry/skatteetaten/skattemelding-api/4.2.0" \
  --root-schema Skattemelding \
  --output-file "gs://my-bucket/schemas/skattemelding.parquet"

Library:

from schema_quarry import build_parquet_schema

result = build_parquet_schema(
    source="https://petstore3.swagger.io/api/v3/openapi.json",
    root_schema="Pet",
    output_file="pet.parquet",
)

print(result.schema)
print(result.parquet_path)

output_file also accepts gs://... URIs and writes them with gcsfs.

Please see the Reference Guide for details.

Tests

Run the full test suite locally with:

uv run pytest

The tests are split into two groups:

  • tests/unit/ checks the building blocks of the project, such as the CLI, the Python library API, and specific OpenAPI-to-Parquet mapping rules
  • tests/golden/ checks that real example inputs still produce exactly the same output as the checked-in reference files

The checked-in test data is stored in tests/resources/:

  • tests/resources/master/openapi/ contains OpenAPI documents used as regression inputs
  • tests/resources/master/parquet/ contains the expected Parquet schemas for those inputs
  • tests/resources/snapshots/schema-text/ contains expected text output for format_schema(...)

In other words:

  • if you change the converter logic, the golden tests will tell you whether the generated Parquet schema changed for any of the reference APIs
  • if you change schema formatting, the snapshot tests will tell you whether the human-readable schema text changed

You can also run the local quality checks with:

uv run ruff check tests
uv run mypy tests

Contributing

Contributions are very welcome. To learn more, see the Contributor Guide.

License

Distributed under the terms of the MIT license, Schema Quarry is free and open source software.

Issues

If you encounter any problems, please file an issue along with a detailed description.

Credits

This project was generated from Statistics Norway's SSB PyPI Template.

Metadata

Release files for schema-quarry 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for schema-quarry 0.0.1
File Size Uploaded
schema_quarry-0.0.1.tar.gz 9.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for schema-quarry 0.0.1
File Interpreter ABI Platform
schema_quarry-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 22.8 kB

Release files / schema_quarry-0.0.1.tar.gz

Download URL schema_quarry-0.0.1.tar.gz
Size 9.8 kB
Tags Source
SHA-256 checksum
How to use checksums
353552c521a623fe4bbff6c53aaec33ebbf0aaebcba091e2f8b4258ba5148d3d
BLAKE2b-256 checksum
How to use checksums
b3e429c88c22eea79e9870ea11291e1b78d0f324f8bebe24d5a187e5ddde4560
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 26, 2026.

Transparency log

Release files / schema_quarry-0.0.1-py3-none-any.whl

Download URL schema_quarry-0.0.1-py3-none-any.whl
Size 13.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
506c0c55eb95239060a172f164f86633fc60a463a615764122f1f2b25f095617
BLAKE2b-256 checksum
How to use checksums
9817a7c8409252a07f072367e04ee8018de7a7c5ef5b02ac6d4126dbb8fc36c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 26, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page