Skip to main content

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

Project description

Author-email: typedef <hello@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

Local development requires uv and a Rust toolchain.

### First-Time Setup

From the root of the repo:

`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

  • To apply changes made to Python code:

    `bash uv sync `

  • To apply changes made to 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 the environment variables.

## 📓 Running Notebooks (VSCode / Cursor)

To run demo notebooks:

  1. Install the Jupyter extension.

  2. Add the .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.1-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.1-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (13.7 MB view details)

Uploaded CPython 3.9+macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

File details

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

File metadata

File hashes

Hashes for langframe-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2dd1ea5556b94fc2d21fd1ff40ec05a6d32e8dc4ed5e3bf333624a0a4d53b3bf
MD5 3e89cc92e0bf40572e5adb8a9c630b3d
BLAKE2b-256 24eb6bf09976243ac15c4f28ea116971938f382e755a5d31481d49eab82066a8

See more details on using hashes here.

File details

Details for the file langframe-0.1.1-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for langframe-0.1.1-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 46a6c283ae62cc2e700418c946ba2943d3474000c897ef1ddf8fb92a2e7c5ef9
MD5 a11d0d581d99d9f64e844302aa488009
BLAKE2b-256 4a141c7daac58400f8bf05e67264bff0c1510d0d8648ebaab0d70f494a5b4d7f

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