Skip to main content

langframe is a Python DataFrame library for processing text data with APIs inspired by PySpark.

Project description

Author-email: typedef <contact@typedef.ai> License: Apache-2.0 Requires-Python: >=3.10, <3.13 Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM Project-URL: Homepage, https://github.com/typedef-ai/langframe Project-URL: Issues, https://github.com/typedef-ai/langframe/issues

# langframe

langframe is a Python DataFrame library for processing text data, with APIs inspired by PySpark. It includes utilities tailored to working with language and special operations called semantic operators, which use large language models (LLMs) to batch-transform data.

## 📁 Directory Structure

The repository is organized as follows:

`bash langframe/ ├── src/langframe/ # Core library │ ├── api/ # Public API (e.g., DataFrame, Column, functions) │ ├── _backends/ # Execution backends: local and cloud (Typedef) │ ├── _logical_plan/ # Logical plan representation for operators ├── rust/ # Rust crates compiled with Maturin ├── tests/ # Test suite structured to match the source layout `

## 🛠️ Development Setup

To get started with local development, you’ll need [uv](https://github.com/astral-sh/uv) and Rust installed.

### First-Time Setup

From the root of the repo, run:

`bash uv run maturin develop --uv `

This will:

  • Create a virtual environment

  • Build the Rust crate

  • Install Python dependencies

  • Set up the package in editable mode

> This command also places the built dynamic Rust library inside src/langframe.

### Making Changes

  • If you’re only working on Python code:

    `bash uv sync `

  • If you make changes to the Rust code:

    `bash uv run maturin develop --uv `

    Add –release or -r to build the Rust crate in release mode (better performance).

## ✅ Running Tests

Run an individual test file:

`bash uv run pytest tests/path/to/test_foo.py `

Run all tests for the local backend:

`bash uv run pytest -m "not cloud" tests `

Run all tests for the cloud backend:

`bash uv sync --extra cloud # Installs cloud-specific dependencies uv run pytest -m cloud tests `

> ⚠️ Note: All tests require a valid OpenAI API key set in your environment variables.

## 📓 Running Notebooks (VSCode / Cursor)

To run demo notebooks:

  1. Install the Jupyter extension.

  2. Add your .venv path to Python: Venv Folders in VSCode settings: - Open settings: Preferences: Open User Settings - Go to Extensions → Python → Python: Venv Folders

  3. Open a notebook, select the correct kernel from your virtual environment, and run cells.

> Restart the kernel to reflect any code changes made to the langframe source.

Have questions or want to contribute? Let us know!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

langframe-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.8 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

langframe-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (7.4 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

File details

Details for the file langframe-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for langframe-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4be0fcc375db0cecfddac70479539b656a3af3184402c0fcfce4c0229eddec92
MD5 5f25375052f8e35aa5a484413fb073f7
BLAKE2b-256 07eb5c091cef8d493fd3ffdacb0288c6f6e87cb21f7d97667dc4a611337df858

See more details on using hashes here.

File details

Details for the file langframe-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for langframe-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 6caa3a543cc89a9169db27a7c314ca05a876a761e6ea38d776cb7394e70ec73c
MD5 d4898d6ec85450055ca6806f14be41f7
BLAKE2b-256 092bf3d6173884dc8421d65c1113c5fd508f2d94ff9f84b6b23155f61c7b4875

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page