Metadata-Version: 2.4
Name: iceframex
Version: 0.1.0
Summary: Unified DataFrame-like API for Apache Iceberg, Delta Lake, and Apache Hemi with distributed execution and a read-write MCP server
Author-email: iceframex maintainers <maintainers@iceframex.dev>
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/iceframex/iceframex
Project-URL: Documentation, https://github.com/iceframex/iceframex/tree/main/docs
Project-URL: Repository, https://github.com/iceframex/iceframex
Project-URL: Issues, https://github.com/iceframex/iceframex/issues
Keywords: iceberg,delta lake,hudi,dataframe,data engineering,lakehouse,mcp,distributed
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Database
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pyiceberg<0.14,>=0.11.0
Requires-Dist: pyarrow>=14.0.0
Requires-Dist: polars>=1.0.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: mcp<3,>=2.1.0
Provides-Extra: aws
Requires-Dist: s3fs>=2023.1.0; extra == "aws"
Requires-Dist: boto3>=1.28.0; extra == "aws"
Provides-Extra: gcs
Requires-Dist: gcsfs>=2023.1.0; extra == "gcs"
Provides-Extra: azure
Requires-Dist: adlfs>=2023.1.0; extra == "azure"
Provides-Extra: delta
Requires-Dist: deltalake>=0.15.0; extra == "delta"
Provides-Extra: hudi
Requires-Dist: getdaft>=0.2.0; extra == "hudi"
Provides-Extra: ray
Requires-Dist: ray>=2.0.0; extra == "ray"
Provides-Extra: dask
Requires-Dist: dask[dataframe]>=2023.1.0; extra == "dask"
Provides-Extra: ingestion
Requires-Dist: iceframex[delta,hudi]; extra == "ingestion"
Requires-Dist: fastexcel>=0.9.0; extra == "ingestion"
Requires-Dist: gspread>=6.0.0; extra == "ingestion"
Requires-Dist: lxml>=4.9.0; extra == "ingestion"
Requires-Dist: html5lib; extra == "ingestion"
Requires-Dist: beautifulsoup4; extra == "ingestion"
Requires-Dist: pandas>=2.0.0; extra == "ingestion"
Requires-Dist: requests; extra == "ingestion"
Requires-Dist: datasets; extra == "ingestion"
Requires-Dist: pyperclip; extra == "ingestion"
Requires-Dist: connectorx>=0.3.0; extra == "ingestion"
Requires-Dist: sqlalchemy>=2.0.0; extra == "ingestion"
Requires-Dist: fpdf2>=2.7.0; extra == "ingestion"
Requires-Dist: markdown-it-py>=3.0.0; extra == "ingestion"
Requires-Dist: pyreadstat; extra == "ingestion"
Provides-Extra: cli
Requires-Dist: typer>=0.9.0; extra == "cli"
Requires-Dist: rich>=13.0.0; extra == "cli"
Provides-Extra: agent
Requires-Dist: openai>=1.0.0; extra == "agent"
Requires-Dist: anthropic>=0.18.0; extra == "agent"
Requires-Dist: google-generativeai>=0.3.0; extra == "agent"
Requires-Dist: rich>=13.0.0; extra == "agent"
Provides-Extra: cache
Requires-Dist: diskcache>=5.6.0; extra == "cache"
Provides-Extra: streaming
Requires-Dist: kafka-python>=2.0.0; extra == "streaming"
Provides-Extra: monitoring
Requires-Dist: psutil>=5.9.0; extra == "monitoring"
Requires-Dist: prometheus-client>=0.19.0; extra == "monitoring"
Provides-Extra: notebook
Requires-Dist: ipython>=8.0.0; extra == "notebook"
Requires-Dist: ipywidgets>=8.0.0; extra == "notebook"
Provides-Extra: pydantic
Requires-Dist: pydantic>=2.0.0; extra == "pydantic"
Provides-Extra: datafusion
Requires-Dist: datafusion>=35.0.0; extra == "datafusion"
Provides-Extra: viz
Requires-Dist: altair>=5.0.0; extra == "viz"
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: pytest-timeout>=2.3.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: ruff>=0.0.270; extra == "dev"
Requires-Dist: mypy>=1.3.0; extra == "dev"
Requires-Dist: pyiceberg[sql-sqlite]>=0.11.0; extra == "dev"
Requires-Dist: typer>=0.9.0; extra == "dev"
Requires-Dist: rich>=13.0.0; extra == "dev"
Requires-Dist: pandas>=2.0.0; extra == "dev"
Provides-Extra: all
Requires-Dist: iceframex[aws,azure,gcs]; extra == "all"
Requires-Dist: iceframex[delta,hudi]; extra == "all"
Requires-Dist: iceframex[dask,ray]; extra == "all"
Requires-Dist: iceframex[ingestion]; extra == "all"
Requires-Dist: iceframex[cli]; extra == "all"
Requires-Dist: iceframex[agent]; extra == "all"
Requires-Dist: iceframex[cache,datafusion,monitoring,notebook,pydantic,streaming,viz]; extra == "all"
Dynamic: license-file

# iceframex

**Unified DataFrame-like API for Apache Iceberg, Delta Lake, and Apache Hudi** — with distributed execution and a read-write MCP server.

[![PyPI version](https://badge.fury.io/py/iceframex.svg)](https://pypi.org/project/iceframex/)
[![License: Apache-2.0](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)
[![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/)

## Why iceframex?

iceframex is a fork of [IceFrame](https://github.com/AlexMercedCoder/iceframe) that bridges three key gaps:

| Gap | IceFrame | iceframex |
|-----|----------|-----------|
| Table formats | Iceberg only | Iceberg + Delta Lake + Apache Hudi |
| Compute | Single-node only | Ray / Dask distributed execution |
| MCP server | Read-only | Read-write (opt-in) |
| Python floor | 3.10 | 3.9 |

One `UnifiedTable` API works across all three lakehouse formats:

```python
from iceframex import UnifiedTable

config = {
    "uri": "http://localhost:8181",
    "type": "rest",
    "warehouse": "s3://my-bucket/warehouse",
}

ice = UnifiedTable(config)                          # Iceberg (default)
ice_delta = UnifiedTable(config, format="delta")    # Delta Lake
ice_hudi  = UnifiedTable(config, format="hudi")     # Apache Hudi

ice.create_table("db.users", schema=arrow_schema)
df = ice.read_table("db.users", limit=100)
ice.append_to_table("db.users", new_rows)
```

## Install

```bash
pip install iceframex
```

### Extras

```bash
# Cloud storage
pip install iceframex[aws,gcs,azure]

# Multi-format (Delta, Hudi)
pip install iceframex[delta,hudi]

# Distributed execution (Ray, Dask)
pip install iceframex[ray,dask]

# CLI
pip install iceframex[cli]

# LLM agent tooling
pip install iceframex[agent]

# Everything
pip install iceframex[all]
```

## Quick start

### Create and write a table

```python
import pyarrow as pa
from iceframex import UnifiedTable

config = {
    "uri": "http://localhost:8181",
    "type": "rest",
    "warehouse": "s3://my-bucket/warehouse",
}
ice = UnifiedTable(config)

schema = pa.schema([
    pa.field("id", pa.int64()),
    pa.field("name", pa.string()),
    pa.field("created_at", pa.timestamp("us")),
])

ice.create_table("db.users", schema)
ice.append_to_table("db.users", {"id": [1, 2], "name": ["Alice", "Bob"]})
```

### Read with Polars

```python
df = ice.read_table("db.users", columns=["id", "name"], limit=50)
print(df)
```

### Distributed execution (Ray)

```python
from iceframex import UnifiedTable
from iceframex.distributed import DistributedEngine

ice = UnifiedTable(config)
engine = DistributedEngine(backend="ray")

df = engine.read_table(ice, "db.events", columns=["id", "ts"], num_partitions=8)
engine.write_table(ice, "db.events_out", df, mode="append")
engine.shutdown()
```

### Read-write MCP server

Start the server (read-write by default):

```bash
export ICEBERG_CATALOG_URI=http://localhost:8181
export ICEBERG_CATALOG_TYPE=rest
export ICEBERG_WAREHOUSE=s3://my-bucket/warehouse
iceframex-mcp
```

Connect any MCP client. Available tools include:

**Read:** `list_tables`, `describe_table`, `get_schema`, `execute_query`, `get_table_stats`, `table_exists`

**Write** (requires `ICEFRAMEX_MCP_READ_ONLY=0`): `create_table`, `append_to_table`, `overwrite_table`, `delete_from_table`, `drop_table`

To run read-only (safer for shared agents):

```bash
export ICEFRAMEX_MCP_READ_ONLY=1
iceframex-mcp
```

### CLI

```bash
iceframex list-tables --config-uri http://localhost:8181 --config-type rest --namespace db
iceframex read-table --config-uri http://localhost:8181 --config-type rest --table db.users
iceframex mcp
```

## Architecture

* `iceframex.core.UnifiedTable` — single entry point, format-agnostic CRUD.
* `iceframex.formats` — pluggable backends (`IcebergBackend`, `DeltaBackend`, `HudiBackend`) behind `BaseTableBackend`.
* `iceframex.distributed.DistributedEngine` — Ray/Dask-backed parallel reads and writes.
* `iceframex.mcp.server` — stdio MCP server with optional read-write mode.

## Roadmap

- [ ] True distributed scan pushdown (not just client-side repartition)
- [ ] Delta Lake `merge` / upsert support
- [ ] Hudi write support via native Hudi (not just Daft)
- [ ] More ingestion sources (Kafka, SQL, HTML, etc.)
- [ ] Async API

## Contributing

See [CONTRIBUTING](CONTRIBUTING.md) in the IceFrame repo — patterns apply here too. Pull requests welcome.

## License

Apache-2.0. See [LICENSE](LICENSE).

## Attribution

iceframex is a fork of [IceFrame](https://github.com/AlexMercedCoder/iceframe) by Alex Merced, licensed under Apache-2.0. The core table operations, catalog handling, and expression system are derived from IceFrame.
