Skip to main content

Pivotal

Pivotal is a data analysis language for Python. It offers a concise syntax for common data operations that compiles to Pandas, Polars or DuckDB code. With comprehensive JupyterLab and VS Code support (syntax highlighting, autocomplete, interactive viewer and GUI controls) Pivotal provides a friendly entry point to the Python data ecosystem.

Website: www.pivotal-lang.org


A live-demo of Pivotal in Jupyter Lab is available via Binder:

JupyterLab demo

What's New In 0.7.0

  • Target-first weighted aggregation blocks, with comma-separated columns or named target lists sharing one weight column
  • Named Pivotal lists for built-in aggregations such as agg mean measures
  • Native Pivotal scalar and dictionary path references in load statements
  • Compatibility fixes for weighted aggregation, dataframe columns named weight, and multi-case assignment headers with trailing whitespace

See the full changelog at: https://github.com/nealbob/pivotal-py/blob/master/CHANGELOG.md

Features

Readable, writable syntax — write data transformations in a concise declarative syntax that feels familiar to SQL and Pandas users

Multiple backends — compile to Pandas, Polars, or in-process DuckDB SQL

JupyterLab and VS Code integration — syntax highlighting, autocomplete, %%pivotal cell magic, interactive object viewer and explorer, and GUI controls

AI support — ask an LLM or coding agent to generate, run, verify, and compare Pivotal code via the Pivotal MCP server

Comprehensive data pipelines — build full workflows with data-quality checks, pipeline functions, column loops, and loadable config / metadata values

Plotting and tables — create charts and publication-ready tables with simple syntax, backed by matplotlib and Great Tables

Data packages — export DataFrames, charts, and tables to a single Frictionless data package

Python integration — call Python functions, load Python variables, and mix Pivotal and Python code as needed


Installation

pip install pivotal-lang

This installs the full feature set — Pandas, Polars, DuckDB, Great Tables.

For a minimal Pandas-only install:

pip install --no-deps pivotal-lang
pip install lark pandas matplotlib

JupyterLab extension

pip install pivotal-lab

VS Code extension

Install from the VS Code Marketplace, or build locally from editors/vscode.


Documentation

Full documentation including the complete syntax reference, backend guide, and API reference:

docs.pivotal-lang.org


Contributing

Contributions are welcome! Please open an issue or pull request on GitHub.

To install the developer test dependencies:

pip install .[test]

The JupyterLab Playwright smoke test is optional. To install its dependency:

pip install .[jupyter-test]
python -m playwright install chromium

License

MIT


Authors

Neal Hughes


Version History

  • v0.1.0 — Initial release

  • v0.2.0 — Breaking grammar changes and major new features

    • Breaking: df <name> renamed to with <name>; copy syntax changed from df <name> from <source> to with <source> as <name>
    • Breaking: load syntax flipped from load <name> "path" to load "path" as <name>
    • New from statement for database connections (SQLite, DuckDB, SQLAlchemy URIs)
    • Full VS Code extension: data viewer, Python↔VS Code bridge, snippets with tab-stops, hover documentation
    • Improved error messages: friendly syntax errors, semantic validator (unknown table/column detection), runtime error filter with expandable tracebacks
    • AG Grid viewer: polished UI, column auto-fit, cell text selection, column pin menu
    • VS Code viewer opens in a horizontal split; quick-open command (Ctrl+Shift+O) to search all loaded data, charts and tables
    • Full install by default — dropped pivotal[all] extras syntax
  • v0.3.0 — New language features and fixes

    • else clause in conditional assignments: col = expr where condition else default
    • else default branch in multi-case (where / where / else) assignments
    • Scalar min() and max() in column expressions, supported across all backends
    • Fixed syntax highlighting gaps in VS Code and JupyterLab extensions
    • Fixed Pygments lexer missing keywords (else, end, and others)
  • v0.5.0 - Major syntax, MCP, docs, and editor release

    • Added bulk load, column for loops, regex transforms, regex selection, data-quality commands, native values, and pipeline functions
    • Added structured AI verification / comparison APIs and both local and hosted MCP server modes
    • Added complete syntax and command-reference docs, plus versioned online docs
    • Improved JupyterLab and VS Code highlighting, autocomplete, viewer rendering, and packaging
    • See CHANGELOG.md on GitHub for the full release notes
  • v0.6.0 - Native expressions, persistence syntax, and notebook fixes

    • Added backend-independent expression and condition IR with compatibility fallbacks
    • Added explicit package, file, and managed-table save syntax
    • Added explicit line continuation
    • Fixed JupyterLab autocomplete navigation and faceted plot titles
    • See CHANGELOG.md on GitHub for the full release notes
  • v0.7.0 - Aggregate lists, target-first weighted means, and native load paths

    • Added comma-separated and named-list aggregation targets
    • Added target-first weighted aggregation blocks with one shared weight column
    • Fixed native Pivotal scalar and dictionary path references in load
    • Preserved legacy weighted syntax and columns named weight
    • See CHANGELOG.md on GitHub for the full release notes

Contact & Support

For questions, issues, or feature requests please open an issue on GitHub or contact hughes.neal@gmail.com.

Download files

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

Source Distribution

pivotal_lang-0.7.0.tar.gz (216.2 kB view details)

Uploaded Source

Built Distribution

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

pivotal_lang-0.7.0-py3-none-any.whl (154.3 kB view details)

Uploaded Python 3

File details

Details for the file pivotal_lang-0.7.0.tar.gz.

File metadata

  • Download URL: pivotal_lang-0.7.0.tar.gz
  • Upload date:
  • Size: 216.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for pivotal_lang-0.7.0.tar.gz
Algorithm Hash digest
SHA256 72407a585d6d30b5b9ae5a129a186d6c82457030622e43975bd106332f63b1b7
MD5 398c33069b07c220b0bbcf75a4dd8e09
BLAKE2b-256 4181d556b834d84fc3c848d0b301c1d775bf793574b343128243d6760b6e9086

See more details on using hashes here.

File details

Details for the file pivotal_lang-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: pivotal_lang-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 154.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for pivotal_lang-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 afb76c2b74117c7c1d24c916c6972300785c9871d6849058a8fe7bb4bf9bf5d2
MD5 9fefb64deb3aaf7bfc12d80eb4d0d623
BLAKE2b-256 c448540f5fc7382ddeac67fdfb49bca041cfd94f83edfae3c0733b2771de5300

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.7.0 This release

2 files

0.6.0

2 files

0.5.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.1

2 files

0.1.0

2 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