Skip to main content

god — a grammar of data, for Python

One small vocabulary for manipulating tables, spelled the same way in Python, in R, and as plain text. A pipeline is checked whole before any of it runs, so a bad column is reported at the step that names it rather than failing partway through — or worse, not failing.

import pandas as pd
from god import *

sales = pd.read_csv("sales.csv")

sales >> keep(col.region == "West") \
      >> summarize(margin = total(col.margin), by = col.product)

The same sentence runs as plain text, byte-for-byte what you would paste into R or into a database:

run("""
sales
  then keep where [region] is "West"
  then summarize [margin] as total([margin]) by [product]
""")

And when you reach the edge of the vocabulary, it shows you the same pipeline in a tool you already know — show_as(pipeline, "pandas"), or "polars", "pyspark", "dplyr", "sql", "spark".

Installing

pip install grammar-of-data

Then import god. The wheel carries its own engine, so there is nothing else to install.

Every word answers for itself

help(god.keep), help(god.summarize), help(god.add_combinations) — every verb, function and grammar word has a page with a worked example, a small table going in and the answer coming out.

The two names to know

A column is col.name, because Python cannot look one up in your data the way R does. The pipe is >>. Those are the only two differences from the R spelling, and the rest of the vocabulary is identical.

The manual, live in both languages, is at https://psychometrician.github.io/god-book/.

Metadata

Release files for grammar-of-data 0.2.3

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

Built distributions (wheels)

Table of built distributions (wheels) for grammar-of-data 0.2.3
File Actions
grammar_of_data-0.2.3-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for grammar_of_data-0.2.3-py3-none-win_amd64.whl
grammar_of_data-0.2.3-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details for grammar_of_data-0.2.3-py3-none-manylinux_2_28_x86_64.whl
grammar_of_data-0.2.3-py3-none-manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.28+ ARM64 Details for grammar_of_data-0.2.3-py3-none-manylinux_2_28_aarch64.whl
grammar_of_data-0.2.3-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for grammar_of_data-0.2.3-py3-none-macosx_11_0_arm64.whl
grammar_of_data-0.2.3-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details for grammar_of_data-0.2.3-py3-none-macosx_10_12_x86_64.whl

Total release size: 3.1 MB

Release files / grammar_of_data-0.2.3-py3-none-win_amd64.whl

Download URL grammar_of_data-0.2.3-py3-none-win_amd64.whl
Size 544.0 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
0ae0bde994580a5f49f36fa5c998f0a729d7b96f75a56d22fdef6137487d3f25
BLAKE2b-256 checksum
How to use checksums
799bb76ea2fa9fd5bee345b37792c8d47beb78df3b9868aabaf920876736714c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 27, 2026.

Transparency log

Release files / grammar_of_data-0.2.3-py3-none-manylinux_2_28_x86_64.whl

Download URL grammar_of_data-0.2.3-py3-none-manylinux_2_28_x86_64.whl
Size 663.0 kB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
bd55e7ae2e73145724a9475225a4e3af63dc818baaa248d379f226a4871c415a
BLAKE2b-256 checksum
How to use checksums
81b1eea64c7691860438ec678ffd60380150243c54568f52f7c107f5ba9ecf92
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 27, 2026.

Transparency log

Release files / grammar_of_data-0.2.3-py3-none-manylinux_2_28_aarch64.whl

Download URL grammar_of_data-0.2.3-py3-none-manylinux_2_28_aarch64.whl
Size 635.3 kB
Tags Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
d038fc6af6e2c8e74b5450dbfbc8fe1a932beeb5814ee2027b8ac13ed96c1e97
BLAKE2b-256 checksum
How to use checksums
11204409db31d3bcbee2517821d469aff38be3523c5cf04bfb94217fbbe33f97
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 27, 2026.

Transparency log

Release files / grammar_of_data-0.2.3-py3-none-macosx_11_0_arm64.whl

Download URL grammar_of_data-0.2.3-py3-none-macosx_11_0_arm64.whl
Size 605.7 kB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
6eb37134dbc9c7d543f8254145b726afefb8e77c0e3587748210185d97d5b0cf
BLAKE2b-256 checksum
How to use checksums
fac4b3c27893e154db2015c9606ef3f7766f79be1fc6f7c4331c09a465a46aa0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 27, 2026.

Transparency log

Release files / grammar_of_data-0.2.3-py3-none-macosx_10_12_x86_64.whl

Download URL grammar_of_data-0.2.3-py3-none-macosx_10_12_x86_64.whl
Size 641.5 kB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
b64e910d567cea6226e297ec8dbdc5c230adc97f12461a6d6bb0e6292708a7d3
BLAKE2b-256 checksum
How to use checksums
958ae1ffebebbce700f26db6fe44eededf2139e12b5741a07ed0ac299fd927a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 27, 2026.

Transparency log

Security for grammar-of-data 0.2.3

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 5 files in this release have been uploaded with provenance metadata.

Select from 5 files

Attestation for grammar_of_data-0.2.3-py3-none-win_amd64.whl

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 27, 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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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