Skip to main content

json-schema-filter

PyPI version Publish

A library that uses jsonschema to filter the objects

Usage

from json_schema_filter import JsonSchemaFilter

schema = {
    "properties": {
        "name": {
            "type": "string",
            "equals": "Shakespeare"
        }
    },
    "required": ["name"]
}

input_data = [
    {"name": "what is in the name"},
    {"name": "Shakespeare"},
    {"name": "hamlet"},
]

print(JsonSchemaFilter(schema).filter(input_data))

# output
"""
Total Selected: 1
Filtered Item: [0]
        1. name: Values not equal. Expected: Shakespeare, Found: what is in the name
Filtered Item: [2]
        1. name: Values not equal. Expected: Shakespeare, Found: hamlet
"""

Supported additional properties

Property Supported type Description
equals * Check if value matches
iequals string Check if value matches (case insensitive)
nequals * Check if value does not match

Release files for json-schema-filter 0.3.0

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

Source distribution (sdist)

Source distribution for json-schema-filter 0.3.0
File Size Uploaded
json_schema_filter-0.3.0.tar.gz 4.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for json-schema-filter 0.3.0
File Interpreter ABI Platform
json_schema_filter-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.9 kB

Release files / json_schema_filter-0.3.0.tar.gz

Download URL json_schema_filter-0.3.0.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b56727f35907299b486f5f0f00db7b4a718d962df8f6ab570a36c7055aca67b8
BLAKE2b-256 checksum
How to use checksums
f66de7a916fa8331c4c4cb298ee429fecdc071c128ad6a090740abc808d716f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.10.0 Darwin/23.0.0

Release files / json_schema_filter-0.3.0-py3-none-any.whl

Download URL json_schema_filter-0.3.0-py3-none-any.whl
Size 7.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d96db69b20fea840e23d1b005a9e564bcf0627cef333ccca95b10f612480358f
BLAKE2b-256 checksum
How to use checksums
4453948a76012a99feeb42afbaf66d2264c34b9b7cfdbc749f476930de17c082
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.10.0 Darwin/23.0.0

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.0

2 release files

0.1.0

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