Skip to content

An open source library to automatically generate ArrayLists of Plain Old Java Objects for importing, sorting, and filtering data.

License

Notifications You must be signed in to change notification settings

jbsooter/AutomaticCSV

Repository files navigation

AutomaticCSV

An open source library to automatically generate ArrayLists of Plain Old Java Objects for importing, sorting, and filtering data.

Maven Central License: MIT

Full Documentation

Features

  • Import CSV files as ArrayLists of Java objects, with support for the Integer, Double, Boolean, String, LocalDate, and LocalDateTime datatypes.
  • Autogenerate Comparators and Predicates for sorting and filtering your data via the Stream API.
  • Pretty Print ArrayLists in tabular format.
  • Write manipulated data out to CSV.
  • Support for hosted CSVs

Getting Started

  1. Add the AutomaticCSV dependancy to your Gradle or Maven Project. (Maven Central)
//Gradle
implementation 'io.github.jbsooter:AutomaticCSV:0.1.4'
  1. Create a new AutoReadCSV object and read in your file as an ArrayList of the top-level Object class.
AutoReadCSV rCSV = new AutoReadCSV(new URL("https://raw.githubusercontent.com/jbsooter/AutomaticCSV/2121390239d2e3b4e2dd19045cb06d018e53fb83/data/menu.csv"),"Menu.csv");
//AutoReadCSV rCSV = new AutoReadCSV("/path/to/csv"); //Local CSV syntax
ArrayList<Object> csvList = rCSV.readCSV();

Run your program. Now, swap out the top-level Object class for the newly generated class, Menu.

ArrayList<Menu> csvList = rCSV.readCSV();
  1. Done!

Further Documentation:

Datatyping and Import Details

Sorting and Filtering

About

An open source library to automatically generate ArrayLists of Plain Old Java Objects for importing, sorting, and filtering data.

Topics

Resources

License

Stars

Watchers

Forks

Languages