Skip to main content

gog for Python

Draw a plot by describing it. You name a table, a shape to draw, and which column goes to which part of the picture. gog turns that description into an SVG.

One engine, written in Rust, does the drawing for R, Python, Julia and JavaScript. Each language writes the plot in its own idiom and gets back the same picture, to the byte.

Why you might want this

One vocabulary instead of a hundred chart types. There is no histogram() to look up, and no arguments that belong to it alone. The whole vocabulary fits on one page, and the combinations are the chart types: a histogram is bar * bin, a bar shape plus a binning statistic. Keep the statistic and change the shape, and the same counts draw a line, an area or a step. You learn the words once and they keep working.

It says no, and says what to write instead. Ask for something the grammar cannot mean and you get a refusal that names the fix. Nothing is accepted and then quietly dropped, so a plot that draws is a plot that means what you wrote.

The same picture from four languages. A colleague working in R, Julia or JavaScript writes the same sentence in their own idiom and gets the same file, to the byte. A team that does not share a language can still share a plot.

A plot is data, not code. What you build is a description that the engine draws, so it can be saved, compared, generated by another program, or sent over a network. That is awkward when a plot is a live object inside a session.

Things that usually need a second package are already here — three dimensions, animation, circular layouts, treemaps and contour maps are part of the same vocabulary rather than add-ons with a syntax of their own.

Install

pip install gog

The wheel carries the drawing engine, so there is nothing else to install and no Rust toolchain to set up.

Your first plot

from gog import *

gm = {"gdp": [1000, 8000, 30000],
      "life": [52, 68, 79],
      "continent": ["Africa", "Asia", "Europe"]}

p = data(gm) + point + x(col.gdp, scale="log") + y(col.life) + color(col.continent)
save_svg(p, "life.svg")

Read that aloud: "Given gm: points, x is gdp on a log scale, y is life, color by continent." That is the whole idea. A plot is a sentence, and you can say it before you can write it.

A table is a dict of columns, or anything with .columns and df[name] — a pandas or polars frame works, and neither is required.

What you can draw

Shapes — points, lines, bars, areas, steps, error bars, boxes, ribbons, text, paths, reference lines, shaded regions, and surfaces in three dimensions.

Ways to show a column — position, color, size, shape, texture, transparency, or a split into one series per group.

Statistics, written into the sentence — binning, counting, sums, averages, medians, ranges, smoothing curves and density estimates. You do not calculate them beforehand.

Arrangements — small multiples in rows or columns, several plots on one page, a circular layout, a third dimension, and animation over a column.

There are no chart-type functions. A histogram is bar * bin, a pie is a bar chart in a circle, and a violin is a density drawn as a ribbon. Learn the words once and they combine.

When a plot cannot be drawn, gog says so and names what to write instead. It never quietly ignores part of what you asked for.

Two things Python needs

A column is col.name. Python has no bare names, and here a plain string is a value, as in style(color="tomato"). Writing x("gdp") is refused, with the correct spelling named. Use col["life exp"] for a name with a space in it.

from gog import * replaces six builtins — bin, sum, min, max and range are statistics here, and map is a coordinate space. If you need the originals in the same file, use import gog and write gog.point, or take one back with from builtins import sum.

Examples

The manual is a book, and every plot in it is drawn by the engine while the page is being built. Nothing in it is a screenshot.

https://psychometrician.github.io/gog-book/

It is written in R, and every sentence translates by the two rules above. The book's Python chapter is the difference list, about a page long.

License

Apache License 2.0. See LICENSE and NOTICE, which ship inside the package.

Metadata

Release files for gog 0.5.0

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

Total release size: 17.4 MB

Release files / gog-0.5.0-py3-none-win_amd64.whl

Download URL gog-0.5.0-py3-none-win_amd64.whl
Size 3.3 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
ec0d6b6420337c9e8a718bc5cc03b1b5eff30d746ad32f7df9acbe9a2060a432
BLAKE2b-256 checksum
How to use checksums
b0e2bd74ffe8f521395c684ee9a644b792522df2c0efe71951f94277a7294178
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 4, 2026.

Transparency log

Release files / gog-0.5.0-py3-none-manylinux_2_28_x86_64.whl

Download URL gog-0.5.0-py3-none-manylinux_2_28_x86_64.whl
Size 3.7 MB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
e4d0377a2761eeadefc046721a40304373c4b29f93cb98c298c5087a899b2ecc
BLAKE2b-256 checksum
How to use checksums
449d8d0450e8624ea15c3f2b090032d047e0ad8ab663d1ef6f17214e7e2768ba
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 4, 2026.

Transparency log

Release files / gog-0.5.0-py3-none-manylinux_2_28_aarch64.whl

Download URL gog-0.5.0-py3-none-manylinux_2_28_aarch64.whl
Size 3.6 MB
Tags Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
b6faadb94831dcd22d5cfa229d287b222a95323e099214a6fd7b530d0d7e65ba
BLAKE2b-256 checksum
How to use checksums
a2ce95805c517c9223f389e576a9577fb12adba02904c456c0ae2a3718d4f512
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 4, 2026.

Transparency log

Release files / gog-0.5.0-py3-none-macosx_11_0_arm64.whl

Download URL gog-0.5.0-py3-none-macosx_11_0_arm64.whl
Size 3.3 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ec72377471d798fc6b0e7c0adbc82e6c9f4bed1c46fc3536c9053f4b59072ad2
BLAKE2b-256 checksum
How to use checksums
1a9de2a9041348394f466ece1f6ca1ae48f4ff66dd0cbd4cc16e1269fba0834c
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 4, 2026.

Transparency log

Release files / gog-0.5.0-py3-none-macosx_10_12_x86_64.whl

Download URL gog-0.5.0-py3-none-macosx_10_12_x86_64.whl
Size 3.5 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
2b9e9dfc16f2f26245eb6a74821a873128384d96eab93bb996ee9acaee1d828d
BLAKE2b-256 checksum
How to use checksums
a6ca6b98249471dd2dc10a08b8ca88017ade59c7cce23e69d899c2bd7cd6b2eb
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 4, 2026.

Transparency log

Release history Release notifications | RSS feed

0.6.0

5 release files

0.5.2

5 release files

0.5.1

5 release files

This release

0.5.0 This release

5 release files

0.4.1

5 release files

0.4.0

5 release files

0.3.0

5 release files

0.2.0

5 release files

0.1.0

5 release files

0.0.5

5 release files

0.0.4

5 release files

0.0.3

5 release files

0.0.2

5 release files

0.0.1

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