molniya
v0.0.2
Published
A simply typed DataFrame library with zero dependencies that honors your memory.
Downloads
203
Maintainers
Readme
What is Molniya?
Molniya is a DataFrame library built specifically for Bun. It helps you load, transform, and analyze structured data without the complexity of heavy frameworks.
Think Pandas for Python, but designed for TypeScript and Bun from the ground up.
Install
bun add molniyaQuick Start
Simple and clean - operations throw errors when they fail:
import { fromArrays, filter, select } from "molniya";
const df = fromArrays({
name: ["Alice", "Bob", "Charlie"],
age: [25, 30, 35],
city: ["NYC", "LA", "Chicago"],
});
// Throws if error occurs - no Result unwrapping needed
const adults = filter(df, "age", ">=", 30);
const result = select(adults, ["name", "city"]);
console.log(result.toString());Error handling: Wrap in try/catch when you need to handle errors:
try {
const df = fromArrays({ ... });
const filtered = filter(df, "age", ">=", 30);
} catch (error) {
console.error("Operation failed:", error);
}Type inference: TypeScript infers schema types automatically:
const df = fromArrays({
name: ["Alice"], // Type: DataFrame<{ name: "string", age: "float64" }>
age: [25],
});Why Molniya?
Schema-first design
Define your data types once, get type safety and optimizations everywhere.Built for Bun
Uses Bun's file I/O and SIMD capabilities. No polyfills, and unfortunately no Node.js compatibility layers.Zero dependencies
The entire library has zero runtime dependencies. Install with confidence.Clean error handling
Operations throw errors when they fail - simple and predictable. Wrap in try/catch when needed.
LazyFrame for Large Files
For big datasets, use LazyFrame for automatic query optimization:
import { LazyFrame, DType } from "molniya";
const schema = {
product: DType.String,
category: DType.String,
revenue: DType.Float64,
};
const result = await LazyFrame.scanCsv("sales.csv", schema)
.filter("category", "==", "Electronics") // Pushed down to scan
.filter("revenue", ">", 1000)
.select(["product", "revenue"]) // Only load these columns
.collect(); // Execute optimized planLazyFrame analyzes your query and:
- Predicate pushdown - Filters during CSV parsing
- Column pruning - Only reads needed columns
- Query fusion - Combines operations when possible
Real impact: For a 1GB CSV file, this can mean reading only 100MB.
Learn More
New to Molniya?
- Introduction - Core concepts
- Getting Started - Complete walkthrough
Ready to build?
Need details?
- API Reference - Full API docs
- Data Types - Type system guide
- Lazy Evaluation - Performance optimization
Community
- GitHub - Source code and issues
- Discussions - Ask questions
- Contributing - Help improve Molniya
License
MIT License. See LICENSE for details.
