Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

pyursa

Engine-agnostic dataframes for the agentic AI era. Named for Ursa, the bear, in the tradition of pandas and Polars. One strict, lazy API runs on Polars or DuckDB with identical results. The plan layer adds what AI agents need: structured errors with fixes, undo, lineage, dry runs, token-budgeted summaries, LLM-powered operators, and an MCP server.

import pyursa as pu
from pyursa import col

orders = pu.read_parquet("orders/*.parquet")        # lazy
print(orders.describe_for_llm(tokens=500))           # fits an LLM context window

report = (orders
    .filter(col("qty") > 0, col("status") != "cancelled", intent="valid orders only")
    .with_columns(revenue=col("qty") * col("price"))
    .group_by("region")
    .agg(revenue=col("revenue").sum(), orders=pu.len(), p90=col("price").quantile(0.9))
    .sort("revenue", descending=True))

report.explain()            # dry run: schema, size bounds, compiled query
report.collect("duckdb")    # pyarrow.Table, identical on "polars"
report.undo(2); report.lineage("revenue"); report.write_parquet("report.parquet")
orders.filter(col("quantity") > "5")
# [COLUMN_NOT_FOUND] Column 'quantity' not found in the input of this step.
#   suggestion: Did you mean 'qty'?  ->  col("qty")

Install

pip install "pyursa[all]"     # Polars + DuckDB backends
pip install "pyursa[mcp]"     # + MCP server (pyursa-mcp)

Python 3.10+. From a source checkout: pip install -e ".[dev]".

Highlights

  • Same answers on every engine. One semantics contract (nulls, NaN, sort stability, rounding, decimals, casts, overflow, quantiles, window ties) enforced by conformance tests on every backend. Float sums may differ in the last digits; everything else is identical.
  • Strict types, no silent corruption. Exact Decimal(p,s) math, time-zone-aware Datetime(tz), List/Struct pass-through, strict casts, integer overflow errors; lossy inputs raise errors instead of corrupting data.
  • Complete toolkit. Filters, joins (inner, left, full, semi, anti), group-by with median/quantile/std, window functions (rank, row_number, running totals, lag), when/then, string and date functions, distinct, concat, Parquet/CSV/JSON in and out.
  • Built for agents. Errors are JSON with paste-ready fixes, raised before execution. Immutable frames with history()/undo(), column lineage(), explain() dry runs, and describe_for_llm(tokens=N) that always fits and flags prompt-injection text.
  • LLM operators. llm_filter, llm_map, llm_extract with any major LLM: 53 OpenAI-compatible providers (OpenAI, Gemini, Mistral, Cohere, xAI, DeepSeek, Qwen, Kimi, GLM, Groq, Together, Fireworks, Azure, Vertex, Databricks, Snowflake, Cloudflare, OpenRouter, LiteLLM, Ollama, vLLM, ...) plus native Claude and Amazon Bedrock (Nova, Claude on AWS). Dedup, batching, caching, row/token budgets, cost reports and PII redaction included. See providers.
  • MCP server. Handles instead of data, sandboxed files, a code-free expression parser, per-client session isolation.
  • Fast. About 3–4× pandas on a typical analysis at 2M rows (see scripts/e2e.py).

Documentation

Guide · Types · Agents and MCP · LLM operators · LLM providers · Semantics · API reference · Security · Stability policy · Changelog

Testing

pytest                                    # unit, conformance, provider and security tests
python scripts/e2e.py                     # end-to-end checks, including pandas comparison
python scripts/e2e.py --llm gemini:<model>   # live LLM check with any provider
python benchmarks/agent_bench.py --llm gemini:<model> --allow-code-exec   # agent benchmark

License

Apache-2.0. See LICENSE.

Metadata

Release files for pyursa 1.0.0rc6

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

Source distribution (sdist)

Source distribution for pyursa 1.0.0rc6
File Size Uploaded Provenance
pyursa-1.0.0rc6.tar.gz 181.7 kB With provenance Details

Built distribution (wheel)

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

Total release size: 279.0 kB

Release files / pyursa-1.0.0rc6.tar.gz

Download URL pyursa-1.0.0rc6.tar.gz
Size 181.7 kB
Tags Source
SHA-256 checksum
How to use checksums
68bc7f8ef5145f489dae111e518af98dfbd459531dcb1213dd11ddc60f91c8f5
BLAKE2b-256 checksum
How to use checksums
a9b3b9a4bb77fb5f88db5179c40925a0fcf52e9fd6c25ae9949fa90804afdae9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Release files / pyursa-1.0.0rc6-py3-none-any.whl

Download URL pyursa-1.0.0rc6-py3-none-any.whl
Size 97.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
60156d3607db7be011704edb2fae0cee8f146628a40f38a3144b3e95a298a223
BLAKE2b-256 checksum
How to use checksums
18d88203712cc0f89d293d23fc1d548075ce80f707b8d6d715edd0e5f0381317
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Security for pyursa 1.0.0rc6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pyursa-1.0.0rc6.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

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