Metadata-Version: 2.1
Name: json-schema-filter
Version: 0.1.0
Summary: A library that uses json schema to filter the objects
License: MIT
Author: Bharat Sinha
Author-email: bharat.sinha.2307@gmail.com
Requires-Python: >=3.10,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: jsonschema (>=4.20.0,<5.0.0)
Requires-Dist: pyyaml (>=6.0.1,<7.0.0)
Description-Content-Type: text/markdown

# json-schema-filter
A library that uses `jsonschema` to filter the objects


### Usage
```python
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|*|


