GithubHelp home page GithubHelp logo

pennsignals / aptos Goto Github PK

View Code? Open in Web Editor NEW
150.0 19.0 22.0 74 KB

:sunny: A tool for validating data using JSON Schema and converting JSON Schema documents into different data-interchange formats

License: Apache License 2.0

Python 100.00%
json-schema avro-schema command-line-tool validation python3 data-interchange avro schema-conversion cli

aptos's People

Contributors

rightlag avatar thewindrider avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aptos's Issues

Add instruction on using CLI in windows prompt

The example script in the Data Validation CLI section needs a little adaptation to work in windows prompt, otherwise double quotes won't be recognized and error will be reported as screenshot at bottom.

I may contribute an easy solution for windows to the README, but I don't know how to apply font color to output message in windows prompt.

validate_cli

Add support for Apache Parquet

Currently, aptos supports converting JSON Schema documents into the Apache Avro data-interchange format.

A proposed class in the visitor module (e.g ParquetSchemaVisitor) should yield the converted Parquet document.

Check Python version

aptos currently supports Python versions 3.x. See PEP 373 for details.

When using the CLI with Python versions < 3.x, the following exception is raised:

screen shot 2017-08-11 at 8 02 43 am

It would be helpful if the __main__ module checked the Python version to raise a more informative error message.

Getting unicode error while parsing with avro schema

I just downloaded and installed the tool, but when I am trying to validate against my schema it throws

omponent = SchemaParser.parse(schema)
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python2.7/site-packages/aptos/parser.py", line 16, in parse
component = Creator.create(schema.get('type')).unmarshal(schema)
File "/usr/lib/python2.7/site-packages/aptos/primitive.py", line 28, in create
}identifier.class
KeyError: <type 'unicode'>

I dont have any special character that requires unicode in the my data or schema. Is it possible to pass it as variable?

Add Swagger v3 parsing

I'd like to add support for parsing Swagger (OpenAPI) Specifications. Swagger uses JSON Schema and supports most primitive data types, so the primitive.Creator class factory can be used to create and unmarshal schema instances.

Advantages of adding support for Swagger:

  • Provides a way of documenting existing APIs, in particular, HTTP APIs
  • Adds the ability to validate HTTP response payloads (JSON-formatted)
  • Can reuse existing code to convert Swagger components into different data-interchange formats

I envision the flowchart for this functionality to look like this:

Swagger specifications use responses objects to define the expected responses returned from the HTTP API.

Here is an example of an expected response from the GET /pets endpoint. aptos could validate the HTTP response body using the visitor.ValidaitionVisitor class.

I will create a new branch for this proposed prototype.

OpenAPI Schema

Refactor CLI

Currently, the __main__.py module is a bit messy. I'd like to create a Formatter for successful and unsuccessful operations.

I am open to using a module for term coloring instead of using the TermColors enum, however, I'd like to keep the amount of dependencies to a minimal.

Add support for Google Protocol Buffers

Currently, aptos supports converting JSON Schema documents into the Apache Avro data-interchange format.

A proposed class in the visitor module (e.g ProtobufSchemaVisitor) should yield the converted Protocol Buffers document.

Support for JSON Schema draft-07

It would be great if aptos supported parsing and validating data using the latest JSON Schema specification.

Development of the JSON Schema draft-07 is currently in progress and the last day for feedback is November 20th, 2017. A summary of changes is defined in the latest proposal.

Changes to the Validation Specification

  • Support for if, then, and else
  • writeOnly and readOnly
  • New format json-pointer

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.