8000 GitHub - moustafa-nasr/Fahmatrix: Fahmatrix is a lightweight, modern Java library for working with tabular data, inspired by Python's Pandas and rooted in the idea of making data understanding (fahm) easy on the JVM.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fahmatrix is a lightweight, modern Java library for working with tabular data, inspired by Python's Pandas and rooted in the idea of making data understanding (fahm) easy on the JVM.

License

Notifications You must be signed in to change notification settings

moustafa-nasr/Fahmatrix

Repository files navigation

Fahmatrix Version

Docs Java Platform License

DeepSourceMaven Central

Star Fork Watch

Tweet

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
πŸ” Column filtering by string operations (contains, equals, etc..)
πŸ“Š Aggregations (mean , average , etc.. )
πŸ“Š Grouping, and sorting (coming soon)
🧩 No external dependencies (for now)


πŸ”§ Installation

πŸ“¦ Using GitHub Releases

Visit Releases and download the latest JAR file.
Include it manually in your project’s classpath

🏠 If you're building locally:

git clone https://github.com/moustafa-nasr/fahmatrix.git
cd fahmatrix
./gradlew build

or Test online

Open In Colab

πŸ› οΈ Maven

Add to pom.xml

<dependency>
  <groupId>com.fahmatrix</groupId>
  <artifactId>fahmatrix</artifactId>
  <version>0.1.6</version>
</dependency>

πŸ› οΈ Gradle (kotlin)

Add to build.gradle.kts

dependencies {
  implementation("com.fahmatrix:fahmatrix:0.1.6")
}

πŸ› οΈ Gradle (java)

Add to build.gradle

dependencies {
  implementation 'com.fahmatrix:fahmatrix:0.1.6'
}

πŸ› οΈ Maven Using jitpack.io

Add to pom.xml

	<repositories>
		<repository>
		    <id>jitpack.io</id>
		    <url>https://jitpack.io</url>
		</repository>
	</repositories>

  	<dependency>
	    <groupId>com.github.moustafa-nasr</groupId>
	    <artifactId>Fahmatrix</artifactId>
	    <version>v0.1.6</version>
	</dependency>

πŸ› οΈ Gradle Using jitpack.io

For Java add to build.gradle

    dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url 'https://jitpack.io' }
		}
	}

    dependencies {
	        implementation 'com.github.moustafa-nasr:Fahmatrix:v0.1.6'
	}

For Kotlin add to build.gradle.kts

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url = uri("https://jitpack.io") }
		}
	}

    dependencies {
	        implementation("com.github.moustafa-nasr:Fahmatrix:v0.1.6")
	}

πŸ“š Simple Example Usage

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 String[]{"name","company","city"}).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();
    }
}

πŸ†š Simple Comparison

Library Read Files Aggregations Notes
Fahmatrix βœ“ βœ“ Pure Java
Tablesaw βœ“ βœ“ More dependencies
Apache Arrow βœ“ βœ• Requires setup
Pandas βœ“ βœ“ Python-only

πŸ“œ Docs

You can find compiled Java Docs over here


✨ Features

  • 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 with tail()
  • Tranculate Data
  • Aggregations (count, min, max, sum, mean ,median, standard deviation, 25%, 50%, 70%, custom percentage)
  • Filter data by String operations (contains, equal, equal ignore case, start with , end with, regex , not empty, custom String Predicate)

Coming Soon:

  • Filter data by arithmetic operations (gt, lt, eq, neq)
  • Filter data by Logic operations (and, or, not)
  • 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

πŸ’‘ Why Fahmatrix?

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.


πŸ™Œ Support This Project

If you find Fahmatrix useful, consider sponsoring me to help support ongoing development, documentation, and future features.


πŸ“ License

MIT License. Use it freely in your projects.

About

Fahmatrix is a lightweight, modern Java library for working with tabular data, inspired by Python's Pandas and rooted in the idea of making data understanding (fahm) easy on the JVM.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Contributors 2

  •  
  •  
0