Skip to main content

Neuralake: A simple platform for complex data

Neuralake is a simple query interface for multimodal data at any scale.

With Neuralake, you can define a catalog, databases, and tables to query any existing data source. Once you've defined your catalog, you can spin up a static site for easy browsing or a read-only API for programmatic access. No running servers or services!

The Neuralake client has native, declarative connectors to Delta Lake and Parquet stores. Neuralake also supports defining tables via custom Python functions, so you can connect to any data source!

Here's an example catalog:

Key features

  • Unified interface: Query data across different storage modalities (Parquet, DeltaLake, relational databases)
  • Declarative catalog syntax: Define catalogs in python without running services
  • Catalog site generation: Generate a static site catalog for visual browsing
  • Extensible: Declare tables as custom python functions for querying any data
  • API support: Generate a YAML config for querying with ROAPI
  • Fast: Uses Rust-native libraries such as polars, delta-rs, and Apache DataFusion for performant reads

Philosophy

Data engineering should be simple. That means:

  1. Scale up and scale down - tools should scale down to a developer's laptop and up to stateless clusters
  2. Prioritize local development experience - use composable libraries instead of distributed services
  3. Code as a catalog - define tables in code, generate a static site catalog and APIs without running services

Quick start

Install the latest version with:

pip install neuralake

Create a table and catalog

First, create a module to define your tables (e.g., my_tables.py):

# tcph_tables.py
from neuralake.core import (
    DeltalakeTable,
    ParquetTable,
    Filter,
    table,
    NlkDataFrame,
    Partition,
    PartitioningScheme,
)
import pyarrow as pa
import polars as pl

# Delta Lake backed table
part = DeltalakeTable(
    name="part",
    uri="s3://my-bucket/tpc-h/part",
    schema=pa.schema(
        [
            ("p_partkey", pa.int64()),
            ("p_name", pa.string()),
            ("p_mfgr", pa.string()),
            ("p_brand", pa.string()),
            ("p_type", pa.string()),
            ("p_size", pa.int32()),
            ("p_container", pa.string()),
            ("p_retailprice", pa.decimal128(12, 2)),
            ("p_comment", pa.string()),
        ]
    ),
    docs_filters=[
        Filter("p_partkey", "=", 1),
        Filter("p_brand", "=", "Brand#1"),
    ],
    unique_columns=["p_partkey"],
    description="""
    Part information from the TPC-H benchmark.
    Contains details about parts including name, manufacturer, brand, and retail price.
    """,
    table_metadata_args={
        "data_input": "Part catalog data from manufacturing systems, updated daily",
        "latency_info": "Daily batch updates from manufacturing ERP system",
        "example_notebook": "https://example.com/notebooks/part_analysis.ipynb",
    },
)

# Table defined as a function
@table(
    data_input="Supplier master data from vendor management system <code>/api/suppliers/master</code> endpoint",
    latency_info="Updated weekly by the supplier_master_sync DAG on Airflow",
)
def supplier() -> NlkDataFrame:
    """Supplier information from the TPC-H benchmark."""
    data = {
        "s_suppkey": [1, 2, 3, 4, 5],
        "s_name": [
            "Supplier#1",
            "Supplier#2",
        ],
        "s_address": [
            "123 Main St",
            "456 Oak Ave",
        ],
        "s_nationkey": [1, 1],
        "s_phone": ["555-0001", "555-0002"],
        "s_acctbal": [1000.00, 2000.00],
        "s_comment": ["Comment 1", "Comment 2"],
    }
    return NlkDataFrame(frame=pl.LazyFrame(data))
# tcph_catalog.py
from neuralake.core import Catalog, ModuleDatabase
import my_tables

# Create a catalog
dbs = {"tpc-h": ModuleDatabase(my_tables)}
TCPHCatalog = Catalog(dbs)

Query the data

>>> from my_catalog import MyCatalog
>>> from neuralake.core import Filter
>>> 
>>> # Get part and supplier information
>>> part_data = TCPHCatalog.db("tpc-h").table(
...     "part",
...     (
...         Filter('p_partkey', 'in', [1, 2, 3, 4]),
...         Filter('p_brand', 'in', ['Brand#1', 'Brand#2', 'Brand#3']),
...     ),
... )
>>> 
>>> supplier_data = TCPHCatalog.db("tpc-h").table("supplier")
>>> 
>>> # Join part and supplier data and select specific columns
>>> joined_data = part_data.join(
...     supplier_data,
...     left_on="p_partkey",
...     right_on="s_suppkey",
... ).select(["p_name", "p_brand", "s_name"]).collect()
>>> 
>>> print(joined_data)
shape: (4, 3)
┌────────────┬────────────┬────────────┐
│ p_name     │ p_brand    │ s_name     │
│ ---        │ ---        │ ---        │
│ str        │ str        │ str        │
╞════════════╪════════════╪════════════╡
│ Part#1     │ Brand#1    │ Supplier#1 │
│ Part#2     │ Brand#2    │ Supplier#2 │
│ Part#3     │ Brand#3    │ Supplier#3 │
│ Part#4     │ Brand#1    │ Supplier#4 │
└────────────┴────────────┴────────────┘

Generate a static site catalog

You can export your catalog to a static site with a single command:

# export.py
from neuralake.web_export import export_and_generate_site
from tcph_catalog import TCPHCatalog

# Export and generate the site
export_and_generate_site(
    catalogs=[("tcph", TPCHCatalog)], output_dir=str(output_dir)
)

Generate an API

You can also generate a YAML configuration for ROAPI:

from neuralake import roapi_export
from tcph_catalog import TCPHCatalog

# Generate ROAPI config
roapi_export.generate_config(TCPHCatalog, output_file="roapi-config.yaml")

About Neuralink

Neuralake is part of Neuralink's commitment to the open source community. By maintaining free and open source software, we aim to accelerate data engineering and biotechnology.

Neuralink is creating a generalized brain interface to restore autonomy to those with unmet medical needs today, and to unlock human potential tomorrow.

You don't have to be a brain surgeon to work at Neuralink. We are looking for exceptional individuals from many fields, including software and data engineering. Learn more at neuralink.com/careers.

Release files for neuralake 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for neuralake 0.0.5
File Size Uploaded
neuralake-0.0.5.tar.gz 4.5 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for neuralake 0.0.5
File Interpreter ABI Platform
neuralake-0.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 9.6 MB

Release files / neuralake-0.0.5.tar.gz

Download URL neuralake-0.0.5.tar.gz
Size 4.5 MB
Tags Source
SHA-256 checksum
How to use checksums
1cc2ea2c6c996acf988d6bfd0b3c08137627af20266d5156a2bf9a6716444247
BLAKE2b-256 checksum
How to use checksums
e20261a42b5b591d011979e4b791ef326b1535551aa4e52a98231e69d8182714
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.17

Release files / neuralake-0.0.5-py3-none-any.whl

Download URL neuralake-0.0.5-py3-none-any.whl
Size 5.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
988f215af9531b934326ff3a9bc5f3ab67a492efb06d3788d08fd3da5c6d8e01
BLAKE2b-256 checksum
How to use checksums
86a26627f38211808d537a8bbab7dad5ce179ae4d64cf472f8b6eba9e449df9c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.17

Release history Release notifications | RSS feed

This release

0.0.5 This release

2 release files

0.0.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page