🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

schemavault

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Malware was recently detected in this package.

Affected versions:

4.1.04.1.1

schemavault

Hierarchical schema validation with asset management and configuration defaults

pipPyPI
Version
4.1.1
Weekly downloads
0
Maintainers
1
Weekly downloads
 

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

Keywords

schema validation config endpoint mapping defaults assets

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts