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/.

Release files for grammar-of-data 0.2.2

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.2
File
grammar_of_data-0.2.2-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
grammar_of_data-0.2.2-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details
grammar_of_data-0.2.2-py3-none-manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.28+ ARM64 Details
grammar_of_data-0.2.2-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details
grammar_of_data-0.2.2-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details

Total release size: 2.9 MB

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

Download URL grammar_of_data-0.2.2-py3-none-win_amd64.whl
Size 510.1 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
1ed3c2f4cc9a74ed0d8bb0ecba5a95ada0fc6495d50aa7d582529e6c4acaf3d8
BLAKE2b-256 checksum
How to use checksums
c031ecde1db1e8c5cc8d4c7ab77960dba033d98f3f96dc4779822c06320e5909
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 Aug 21, 2026.

Transparency log

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

Download URL grammar_of_data-0.2.2-py3-none-manylinux_2_28_x86_64.whl
Size 633.4 kB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
961bb6b45603636158245f78c4abbf145a76838c00fbb92481111b12761e8124
BLAKE2b-256 checksum
How to use checksums
ecee37d2a7486918c4b90fdbab4055bf99685da62b7363479f0f1c16e06647d5
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 Aug 21, 2026.

Transparency log

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

Download URL grammar_of_data-0.2.2-py3-none-manylinux_2_28_aarch64.whl
Size 603.5 kB
Tags Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
e5ca5d04a06186420374fa4d38468e8730e42e8b13639afa72406ef0b758fff8
BLAKE2b-256 checksum
How to use checksums
b16b9150d60e07e2113f49dfbc4211a765440c590fd0f25d898b06988ecb0969
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 Aug 21, 2026.

Transparency log

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

Download URL grammar_of_data-0.2.2-py3-none-macosx_11_0_arm64.whl
Size 575.1 kB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
af84e7c28e4331c2aad9267e4fe82b8ce10ab10773c0dcedceaa577d7c2ba0f2
BLAKE2b-256 checksum
How to use checksums
0bdf46dfeffd5f8052f851d0704cea36b35862824f00445341646a7e5c6f9a05
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 Aug 21, 2026.

Transparency log

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

Download URL grammar_of_data-0.2.2-py3-none-macosx_10_12_x86_64.whl
Size 608.5 kB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
ddce2e8bc328a628b9166aaf7fefb119d1ddc7f0a741a937f88ee503523f49cb
BLAKE2b-256 checksum
How to use checksums
b64b8a9f50bf1a4b46a7303e924ebcdcad030c0341f24d98b228d2bc48adee39
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 Aug 21, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.2 This release

5 release files

0.2.1

5 release files

0.2.0

5 release files

0.1.0

5 release 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