Skip to main content

Hierarchical schema validation with asset management and configuration defaults

This project has been quarantined.

PyPI Admins need to review this project before it can be restored. While in quarantine, the project is not installable by clients, and cannot be being modified by its maintainers.

Read more in the project in quarantine help article.

Project description

schemavault

Hierarchical schema validation with asset management and configuration defaults for Python services.

Installation

pip install schemavault

Usage

import schemavault

# Validate endpoint configurations
err = schemavault.validate('endpoint', {'url': '/api/v1/users', 'method': 'GET'})
if err:
    raise ValueError(err)

# Build URLs with query parameters
url = schemavault.build_url('https://api.example.com', 'users', {'page': '2'})

# Merge header dictionaries
headers = schemavault.merge_headers(
    {'Accept': 'application/json'},
    {'Authorization': 'Bearer token123'}
)

# Get registry defaults
defaults = schemavault.get_defaults()
print(defaults['timeout'])  # 60000
print(defaults['retries'])  # 5

# Normalize endpoint configuration
normalized = schemavault.normalize_endpoint({
    'url': '  /api/users  ',
    'method': 'get',
    'timeout': '5000'
})

Features

  • Schema validation for REST endpoint configurations
  • URL building with path and query parameter support
  • Header merging and normalization
  • Asset management with embedded metadata support
  • Configuration defaults with transport presets
  • Schema diffing and flattening utilities

API

  • validate(schema_name, obj) — validate against named schema
  • validate_url(url) / validate_method(method) / validate_headers(headers)
  • build_url(base, path, query) — construct URL
  • merge_headers(base, extra) — merge header dicts
  • normalize_endpoint(config) — normalize endpoint config
  • schema_diff(old, new) / flatten(obj) / unflatten(flat)
  • get_defaults() / get_registry(key)

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

schemavault-4.1.1.tar.gz (17.4 kB view details)

Uploaded Source

File details

Details for the file schemavault-4.1.1.tar.gz.

File metadata

  • Download URL: schemavault-4.1.1.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for schemavault-4.1.1.tar.gz
Algorithm Hash digest
SHA256 63a52f56d64b117203c46c529d7768e669e102555b54e245106e6d66f98dc7d1
MD5 1e276f95072779c084b798b7098df0b9
BLAKE2b-256 cb91c9a89aea6f49b2daea3e2fecc80eee9a59de241a05a24a8071a52b770950

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page