Releases: nvn-nil/file-validator
Releases · nvn-nil/file-validator
Release list
0.0.5
More permissive jsonschema dependency requirement
Contents
More permissive jsonschema (jsonschema>=4.4.0) dependency requirement
Add support for validating using definition and schema data
Feature
Content
Add support for validating using definition and schema as data (dictionary). This is very useful when you want finer control over the validation process
Handle deserialized number in metadata schema
Content
Feature
When using cloud storage, metadata stored on the blob is of type Dict[string, string], which means numbers are stored as strings. Retrieving metadata from the blob returns string numbers, which may fail schema validation.
This update introduces a flag for handling number types in the schema when working with cloud metadata. It casts the fields in the passed-in metadata to float before performing metadata validation.
metadata = {"location": "Point(12 13.0)", "elevation": "123", "timezone": "UTC", "file_id": str(uuid4())}
file_path, casted_validated_metadata = validate_file(file_path, metadata, definition_file_path, handle_deserialized_metadata=True)
# {'location': 'Point(12 13.0)', 'elevation': 123.0, 'timezone': 'UTC', 'file_id': 'd4591649-e619-44bd-930a-9076793fc373'}Initial release
Content
Features
- validate file (name, metadata, header) using its file definition