GetSchema is a Python library designed to infer JSON schemas from sample data records. It analyzes diverse data inputs to automatically generate a robust JSON Schema definition. The project is actively maintained, with frequent patch releases addressing bug fixes and minor feature enhancements, currently at version 0.2.11.
pip install getschemaVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use `getschema.infer_schema` to generate a JSON Schema from a list of Python dictionaries representing sample records. The output is a formatted JSON string of the inferred schema.
Upgrade to getschema v0.2.5 or later. If your logic previously relied on this implicit conversion, ensure your input data is pre-processed or adjust your schema expectations accordingly.
If 'nullable string' is not the desired type for fields containing only nulls, explicitly define the expected type in a post-processing step or through custom logic.
Review schemas inferred from fields with only null values if using older versions. Upgrade to a newer version for consistent handling, or explicitly specify the desired type for such fields.
Install the library using pip: `pip install getschema`
Install the pandas library: `pip install pandas`
Ensure the `data` argument passed to `getschema.infer_schema()` is a list of dictionaries, a dictionary, or a similar iterable structure expected by pandas. For example: `getschema.infer_schema([{'key': 'value'}])`Access the schema properties using dictionary keys (e.g., `schema['properties']`) as the returned object is a dictionary representing the JSON schema, not a custom object with methods.
No dependency data recorded yet.