{"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":"python","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,"search_vec":"'0.2.11':48 'activ':32 'address':38 'analyz':17 'automat':22 'bug':39 'current':45 'data':14,19,52 'definit':28 'design':7 'divers':18 'enhanc':44 'featur':43 'fix':40 'frequent':35 'generat':23,56 'getschema':1,2 'infer':9,51 'input':20 'json':10,26,54 'jsonschema':49 'librari':6 'maintain':33 'minor':42 'patch':36 'project':30 'python':5 'record':15 'releas':37 'robust':25 'sampl':13 'schema':11,27,50,55 'valid':53 'version':47","created_at":"2026-04-12T16:47:46.722945+00:00","updated_at":"2026-04-16T15:15:36.226965+00:00","problems":[{"fix":"Install the library using pip: `pip install getschema`","cause":"The 'getschema' Python package is not installed in the current environment or the import statement has a typo.","error":"ModuleNotFoundError: No module named 'getschema'"},{"fix":"Install the pandas library: `pip install pandas`","cause":"The 'getschema' library depends on 'pandas', but 'pandas' is not installed in the current environment.","error":"ModuleNotFoundError: No module named 'pandas'"},{"fix":"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'}])`","cause":"The `infer_schema` function was called with an input data parameter that is `None` or an unexpected non-iterable type, which pandas (a dependency of getschema) cannot process.","error":"TypeError: 'NoneType' object is not iterable"},{"fix":"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.","cause":"After inferring the schema, the user is attempting to call a method on the returned schema object, which is a standard Python dictionary (JSON schema), expecting it to be a custom object with specific methods.","error":"AttributeError: 'dict' object has no attribute 'some_method'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.2.11","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/anelendata/getschema","docs":null,"changelog":null,"pypi":"https://pypi.org/project/getschema/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["serialization","data"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-08-30","next_check":"2026-07-28","install_tag":null}}