A Java library for working with Table data. tableschema-java is a library aimed at parsing CSV and JSON-Array documents into a live Java objects according to Table Schema, a format definition based on JSON Schema.
It allows you to read and write tabular data with assurances to format integrity (it also allows reading and writing CSV free-form, ie. without a Schema). And finally, it converts Java POJOs to and from CSV, similar to Jackson for JSON (mostly).
It was conceived by the guys at Frictionless Data
Please find releases on Jitpack
OK, enough of the PR, how do I actually use that thing. It's not like you are the only CSV parser, so show me the goods.
- Reading data explains various ways of reading data
- Via Java Beans for minimal friction if you already have a domain model
- Without a Schema Read as String arrays and without format integrity assurance
- With a Schema Read as converted Java object arrays with format integrity assurance
- Writing data explains various ways of writing data
- Creating a Schema shows ways of creating a Table Schema from scratch or from example data
- Datapackages documentation on Datapackages to distribute data sets as self-contained units
- Key contraints details ways of working with key constraints
- Validating data: Parsing string data to Field values (casting)
- Row Casting to check String arrays against a Schema
- Field Casting to check Strings against a Field definition
- Javadoc
Found a problem and would like to fix it? Have that great idea and would love to see it in the repository?
Please open an issue before you start working.
It saves a lot of time for everyone, and we are super happy to answer questions and help you along the way. Furthermore, feel free to join frictionlessdata Gitter chat room and ask questions.
This project follows the Open Knowledge International coding standards.
Get started:
# install Java 1.8 or higher (use Jabba if you need to test on different versions) and maven2
$ cd tableschema-java
$ jabba install 1.8
$ jabba use 1.8
$ mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
$ mvn test -B
Make sure all tests pass.