Skip to main content

Simple tool to merge JSON schemas

Project description

https://badge.fury.io/py/skinfer.png https://travis-ci.org/scrapinghub/skinfer.png?branch=master https://pypip.in/d/skinfer/badge.png

Simple tool to infer and/or merge JSON schemas

Features

  • Generating schema in JSON Schema draft 4 format

  • Inferring schema from multiple samples

  • Merging schemas - nice for generating schema in Map-Reduce fashion or updating an old schema with new data

Example of using schema_inferer to generate a schema from a list of samples:

$ cat samples.jsonl
{"name": "Claudio", "age": 29}
{"name": "Roberto", "surname": "Gomez", "age": 72}
$ ./bin/schema_inferer --jsonlines samples.jsonl
{
    "$schema": "http://json-schema.org/draft-04/schema",
    "required": [
        "age",
        "name"
    ],
    "type": "object",
    "properties": {
        "age": {
            "type": "number"
        },
        "surname": {
            "type": "string"
        },
        "name": {
            "type": "string"
        }
    }
}

Install with:

$ pip install skinfer

Or, if you don’t have pip, you can still install it with:

$ easy_install skinfer

History

0.1.2 (2015-08-04)

  • Bugfix: removed buggy -o argument

  • Automated PyPI release via Travis

0.1.1 (2015-05-01)

  • Support more complex string-type schemas

  • Attempt to infer JSON lines format instead of just failing

  • API cleanup: no need for long imports anymore

  • Updated documentation, added docstrings

  • Fixed merging schema for arrays with tuple vs list validation

  • Fixed compatibility issues with Python 2.6

  • Improved test coverage, added end-to-end tests

0.1.0 (2015-03-03)

  • First release on PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

skinfer-0.1.2.tar.gz (21.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

skinfer-0.1.2-py2.py3-none-any.whl (9.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file skinfer-0.1.2.tar.gz.

File metadata

  • Download URL: skinfer-0.1.2.tar.gz
  • Upload date:
  • Size: 21.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for skinfer-0.1.2.tar.gz
Algorithm Hash digest
SHA256 c6f147b8ecc10bf2062095ec3d771d924b0b1f289933f994c95858fb90e95b69
MD5 a13635f256175da665e5e63ce14d3c02
BLAKE2b-256 94a61202d21a61b9a86c7384380ea442f1b9ddfee0b5e35b32ccb731892bb74b

See more details on using hashes here.

File details

Details for the file skinfer-0.1.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for skinfer-0.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d59cde0d65d06bc30f23c197104e76141668399ad4f0ce91ff6fa0c50e7071bf
MD5 8d391f5e27cdac98c0532b2208b125f2
BLAKE2b-256 4905a9d01fda3722f8af63835cfd60bf849553f56173a7740dda75d5b77d104a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page