A library that uses json schema to filter the objects
Project description
json-schema-filter
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 |
---|---|
equals | * |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for json_schema_filter-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71a84fbf152fa085383a117d95bdbedaab9a2e63067121c7412bdda48238042d |
|
MD5 | 06512952b98f95af866dfb68b2c7ea52 |
|
BLAKE2b-256 | 9681dddb2c22aab70a41d8b4dbf821e96ee4200ea179fa51d571629e58cb32e4 |