Fahmatrix is a lightweight, modern Java library for working with tabular data — inspired by Python’s Pandas, but designed specifically for the JVM. It’s early in development, but already offers a clean API for loading, exploring, and manipulating data with zero external dependencies.
Ideal for small projects, backend systems, or embedded environments like Android, Fahmatrix is built to bring structured data handling to every corner of the Java ecosystem.
🚀 Intuitive API for tabular data
📄 Easy CSV, Xlsx, Ods, Json reading and previewing
📄 Easy CSV, Xlsx, Ods, Json writing
🔍 Row filtering and column selection
📊 Aggregations, grouping, and sorting (coming soon)
🧩 No external dependencies (for now)
Visit Releases and download the latest JAR file.
Include it manually in your project’s classpath or use Maven/Gradle if you're pulling from GitHub Packages (to be added in future versions).
If you're building locally:
git clone https://github.com/moustafa-nasr/fahmatrix.git
cd fahmatrix
./gradlew build
or Test online
import com.fahmatrix.DataFrame;
public class Main {
public static void main(String[] args) {
// read csv file
DataFrame df = DataFrame.readCSV("data.csv");
// pretty print data in system console
df.print();
// Pretty Print Data Summary in System Console
// count, min, max, sum, mean ,median, standard deviation, 25%, 50%, 70%
df.describe()
// select certain rows and colums
DataFrame result = df.select().rows(new int[]{1,2,3,5,6,8,110,10000,99}).columns(new int[]{1,2,5}).get();
// save the final data as JSON format
result.writeJson("output.json");
// save the final data as Microsoft Excel
result.writeXlsx("output.xlsx");
// save the final data as OpenDocument Spreadsheet
result.writeOds("output.ods");
// pretty print the last 3 rows
result.tail(3).print();
}
}
Library | Mean | Std Dev | Notes |
---|---|---|---|
Fahmatrix | ✓ | ✓ | Pure Java |
Tablesaw | ✓ | ✓ | More dependencies |
Apache Arrow | ✕ | ✕ | Requires setup |
Pandas | ✓ | ✓ | Python-only |
You can find compiled Java Docs over here
- Load CSV, JSON, Microsoft Excel,Open office ODS files into DataFrame
- Save CSV, JSON, Microsoft Excel,Open office ODS files
- Pretty-print data to console
- View top rows with
head()
or bottom ones withtail()
- Tranculate Data
- Aggregations (count, min, max, sum, mean ,median, standard deviation, 25%, 50%, 70%, custom percentage)
- Filter data by arithmetic operations (gt, lt, eq, neq)
- Filter data by Logic operations (and, or, not)
- Filter data by String operations (contains, equal, equal ignore case)
- GroupBy and pivot tables
- Nested JSON Data
- Data import/export for HTML, Xml, Parquet and more ..
- Type inference and conversion
- DSLInterpreter for SQL language lovers
Java has long lacked a clean, expressive DataFrame API — especially one that feels at home on the JVM.
Fahmatrix is an early-stage project that brings together data clarity (fahm) and structured thinking (matrix) to offer a lightweight, embeddable solution for tabular data processing in Java. Inspired by the elegance of tools like Pandas, Fahmatrix is built from the ground up to serve Java developers — whether you're building small utilities, backend services, or Android apps.
It’s still early days, but the goal is clear: a fast, intuitive, dependency-free DataFrame library that works where Java works.
If you find Fahmatrix useful, consider sponsoring me to help support ongoing development, documentation, and future features.
MIT License. Use it freely in your projects.