Coder Social home page Coder Social logo

csv-test's People

Contributors

dhcole avatar

Stargazers

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

Watchers

 avatar  avatar

csv-test's Issues

Support for JSON Table Schema files?

I know you wrote this to solve a simple problem of validating CSV files, but you have inadvertently created an alternative to the two existing approaches for specifying schemas for CSV files:

Remember that a schema is useful both to describe and validate data (you have the latter part). The first of these schema approaches seems to have the most momentum with apparently several tools for validating it. Most of these however are for validating the metadata specification vs. using that schema to validate the CSV. There is a tool for that, but its functionality is still pretty limited. But it's the most established schema out there for CSV. I just wish I found the functionality of the data validation tool as reliable as this one. What if I could have my cake and eat it too?!

It seems on first glance that the JSON Table Schema is mostly a subset of this one, in that it has fewer innate formats to validate against and simple constraints (no external functions), so in theory, you could also load JSON files in this format and give the world of CSV another tool for validating another schema. A few issues to figure out though:

  • I assume this is just mapping the records in the JSON to whatever you load from the YAML into
  • How to handle primary and foreign key references
  • Can we specify a format string that isn't in the JSON Table Schema spec? This could be useful for specifying formats like MongoDB IDs or such if possible (we can, and it seems to be considered a valid spec)
  • Would we want to provide a means of augmenting the base JSON with additional directives in a supplementary YAML or something?

Anyhow, I just wanted to get the discussion going. Let me know if this seems like a good idea. The one issue about using the format field for specifying more advanced formatting rules only supported by csv-test is that the schema will vary in its rigor depending on which checking program you use. Not sure if that's considered awful or not.

Handle blank columns as NULL values instead of empty strings

I have a CSV with an column that can sometimes be nil. This is indicated in the CSV as an empty column (as opposed to a string like null or nil). It is triggering an issue with the validation for In "in" validation rule failed for input: ''. I suspect this will also be an issue for Integer and other columns. Can we have empty column values generically default to nil before they are validated, since that is what I have usually seen (as opposed to explicit nil values)

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.