{"id":4953,"library":"getschema","title":"GetSchema","description":"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.","status":"active","version":"0.2.11","language":"en","source_language":"en","source_url":"https://github.com/anelendata/getschema","tags":["jsonschema","schema inference","data validation","json","schema generation"],"install":[{"cmd":"pip install getschema","lang":"bash","label":"Install with pip"}],"dependencies":[],"imports":[{"symbol":"infer_schema","correct":"import getschema\n# or\nfrom getschema import infer_schema"}],"quickstart":{"code":"import getschema\nimport json\n\nsample_records = [\n    {\"name\": \"Alice\", \"age\": 30, \"city\": \"New York\"},\n    {\"name\": \"Bob\", \"age\": 24, \"city\": \"London\", \"email\": \"bob@example.com\"},\n    {\"name\": \"Charlie\", \"age\": None, \"city\": \"Paris\"},\n    {\"name\": \"David\", \"age\": 35, \"city\": \"Berlin\", \"hobbies\": [\"reading\", \"hiking\"]}\n]\n\n# Infer schema from a list of records\nschema = getschema.infer_schema(sample_records)\nprint(json.dumps(schema, indent=2))","lang":"python","description":"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."},"warnings":[{"fix":"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.","message":"Versions prior to 0.2.5 incorrectly auto-converted values like 0, 0.0, empty strings (''), and false to `null` during schema inference. This behavior was a bug and has been fixed in v0.2.5 and later.","severity":"breaking","affected_versions":"< 0.2.5"},{"fix":"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.","message":"The default inference for fields containing only `null` values changed in v0.2.10. Prior to this version, such fields might have been inferred as `{\"type\": \"null\"}` or `{\"type\": \"string\"}` (since v0.2.3). From v0.2.10, they default to `{\"type\": [\"null\", \"string\"]}` (nullable string).","severity":"gotcha","affected_versions":"< 0.2.10"},{"fix":"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.","message":"In versions prior to v0.2.3, if a field contained only `null` values across all sample records, the inferred JSON Schema type for that field would be `{\"type\": \"null\"}`. From v0.2.3, this default was changed to `{\"type\": \"string\"}` (and later to `{\"type\": [\"null\", \"string\"]}` in v0.2.10).","severity":"gotcha","affected_versions":"< 0.2.3"}],"env_vars":null,"last_verified":"2026-04-12T00:00:00.000Z","next_check":"2026-07-11T00:00:00.000Z"}