Giter Club home page Giter Club logo

jpif's Introduction

JPIF

Java tools for working with Physical Information Files (http://www.citrine.io/pif).

This package includes java objects for all items in the Physical Information File (PIF). Files formatted in the PIF schema can be serialized and deserialized using included methods.

Compilation

It is possible to build a jar for this package using mvn clean install.

An uber jar containing all of the dependencies can be created using mvn clean install -Pvalidator. This jar can in turn be executed using java -jar target/jpif-validator.jar path/to/pif [max records to validate] in order to validate the content of a file that contains PIF records.

An uber jar containing all of the dependencies can be created using mvn clean install -Pparser. This jar can in turn be executed using java -jar target/jpif-parser.jar path/to/pif in order to read the content of a PIF file, convert to a rigid schema, and print to standard out.

Usages

Reading PIF-formatted sources

Given an input stream, reader, or string, PIF systems can be read using e.g.

PifObjectStream pifObjectStream = new PifObjectStream(inputStream);
for (System system : pifObjectStream) {
    // Do work on system
}
pifObjectStream.close();

Writing PIF records

Writing a single PIF system to a string:

System system = new System();
String systemString = PifObjectMapper.getInstance().writeValueAsString(system);

Writing a list of PIF systems to a string:

List<System> systems = new ArrayList<>();
String systemsString = PifObjectMapper.getInstance().getSystemListWriter().writeValueAsString(systems);

Converting a PIF system, list of PIF systems, or PifObjectStream to an InputStream:

InputStream inputStream = new PifInputStream(pifObjectStream);

jpif's People

Contributors

ericlundberg avatar genfx999 avatar indyaah avatar kjaym avatar kjmichel avatar maxhutch avatar sparadiso avatar

Watchers

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

jpif's Issues

Support for arbitrary data type

We should turn Property.dataType into a string field rather than an enumeration so that people are free to put whatever they want there.

Merge PIF records

Add merge and equals methods to all objects. Allow control over how aggressively to check for ability to merge and equality. Add controls for when to append to lists, replace them, or replace them if present.

Add ReadViews

The pypif library has ReadView objects which present a leaner interface to pifs. We should replicate it in java.

We may want to use reflections to deal with dynamically pulling members from Pio objects.

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.