Skip to main content

Augplot

Describe a plot, refine it in place, and reuse the generated Python

Pass Augplot your notebook data and describe what you want to see. Refine the visualization in plain language, then reuse or export the generated Matplotlib or Seaborn code.

Quick start

Augplot supports Python 3.11 through 3.14.

pip install augplot

Sign in once with an eligible ChatGPT Plus or Pro account, then work directly with data already in your notebook. No API key is needed:

import augplot as ap

ap.sign_in()  # Opens your browser; remembers the connection securely.
flights = ap.load_sns_dataset("flights")
viz = ap.plot(
    flights,
    auth="chatgpt",
    prompt="Plot monthly airline passengers over time, with one line per year.",
)
viz.refine(
    "Turn this into a year-by-month heatmap and highlight the busiest month."
)
viz.to_python(function_name="plot_monthly_passengers")

Later sessions can skip ap.sign_in(). Model selection is automatic; optionally inspect the models available to your account and change the default for future charts:

ap.models()               # Model IDs, names, and the selected default.
ap.set_model("model-id")   # Use an ID returned by ap.models().

ChatGPT sign-in requires permission to use your plan's Codex / ChatGPT Work allowance. The available models may differ from the ChatGPT picker and the API catalog. Extra credits are optional and controlled in ChatGPT's Usage settings; included usage limits still apply. See OpenAI's sign-in guide. Existing API-key providers remain available; see API-provider setup.

Open or download the example notebook to try the complete workflow.

For nested cross-validation results, try the model comparison notebook. It starts with an inline results dictionary, successive refinements, and an intentional ScopeError example.

For a one-sentence plotting request on an open stellar catalog, try the Hertzsprung–Russell notebook. It requests fresh generation with a one-model-call budget. Grouped coverage summaries, shared empirical smoothing, and direct curve labeling support this and other complex charts. Inspect the figure and source: valid execution does not establish visual or scientific correctness. See the evaluation notes for recorded live results and the sample's limitations.

What can data be?

ap.plot(data) accepts these nonempty, in-memory Python objects:

Input Typical use
pandas.DataFrame Rows and columns, including dates and categories.
pandas.Series One labeled sequence of values.
numpy.ndarray One- or two-dimensional numeric or mixed data.
list or tuple Values such as [2, 4, 6], or records such as [{'x': 1, 'y': 2}].
dict Columns such as {'x': [1, 2], 'y': [2, 3]}, or nested results keyed by model and metric.

Nested lists and dictionaries can contain ordinary scalars, missing values, NumPy arrays, and Pandas objects. Parsed JSON is therefore a valid input when its root is a nonempty list or dictionary:

import json

records = json.loads('[{"month": "Jan", "sales": 10}, {"month": "Feb", "sales": 12}]')
viz = ap.plot(records)

results = {
    "baseline": {"test_f1": [0.3, 0.4, 0.5]},
    "candidate": {"test_f1": [0.4, 0.5, 0.6]},
}
viz = ap.plot(results, prompt="Compare F1 scores across models")

Pass the parsed object, not a JSON string or file path. Empty inputs, cyclic containers, custom objects, and NumPy arrays with zero or more than two dimensions raise DataError. For a Pandas Index, another table library, or an iterator, convert to one of the types above first.

Workflow

  • plot() generates the initial visualization.
  • refine() revises the current version and can be repeated.
  • render() applies the current visualization to compatible data without a model call.
  • to_python() exports the current version as standalone Matplotlib or Seaborn code.

Only plot() and refine() may call the configured model. Reuse and export stay local:

viz.render(new_data)
viz.figure.savefig("passengers.png", dpi=300)
viz.to_python(function_name="plot_monthly_passengers")

Inspect the current implementation with viz.code. The exported module needs neither Augplot nor provider credentials; any used plotting helpers are bundled into the export. Smoothed trends require SciPy alongside the usual plotting dependencies.

Configuration

Pass options directly to ap.plot():

viz = ap.plot(
    data,
    backend="seaborn",       # auto, matplotlib, or seaborn
    display_format="retina", # retina, png, or svg
    show=True,
)

See the API and workflow reference for all ap.plot() options and inspectable attributes.

Use auth="chatgpt" to choose your saved ChatGPT connection explicitly. The default, auth="auto", preserves explicitly configured API-provider workflows and otherwise uses that connection. A per-plot model="model-id" overrides the saved ChatGPT default when used with auth="chatgpt". Changing the default does not change existing charts' refinement model.

API-provider setup

For an API-key provider, configure a model and the provider's credentials:

export AUGPLOT_MODEL="openai/YOUR_MODEL_ID"
export OPENAI_API_KEY="..."
viz = ap.plot(data, auth="api_key", prompt="Compare revenue by month")

Use AUGPLOT_MODEL for the model and AUGPLOT_API_BASE for a custom endpoint. API providers use the credentials expected by LiteLLM. The configured model must support strict JSON Schema responses and be recognized as such by LiteLLM; unsupported combinations raise ConfigurationError before inference.

History

Generated and refined plots are saved in .augplot/plots. Matching steps replay without another model call. Use regenerate=True to request new code or cache_dir=None to disable persistence. See visualization history for the replay rules.

When checking a fresh model request, pass regenerate=True to plot() or refine() and check viz.cache_hit. Add max_model_calls=1 to prevent repairs and clarification calls; viz.model_calls reports attempted provider calls. Notebook reruns can otherwise replay saved code. See the manual sign-in checks for a short verification walkthrough.

Data and generated code

Augplot sends the configured model a bounded profile of your data, including samples, field names, statistics, and category counts. This is not anonymization; sample_rows=0 omits samples but not all values or summaries. See model data and privacy for exactly what Augplot sends.

Generated Python is validated, then runs locally against a copy of the data. Rejected code never runs or saves. This is defense in depth, not an OS sandbox. See generated-code guardrails.

Augplot visualizes supplied data only. It can compute plot-related summaries and trends, but does not train models or return predictions, forecasts, or other analytical artifacts.

Beta and security

Augplot 0.3.0 is a beta release; APIs and saved-history formats may change before 1.0. Review generated code before sensitive or security-critical use, and report vulnerabilities through the security policy.

License

Augplot is licensed under the Apache License 2.0.

Development

python -m pip install -e '.[dev]'
python -m pytest
python -m ruff check .
python -m build

Metadata

Release files for augplot 0.3.0

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

Source distribution (sdist)

Source distribution for augplot 0.3.0
File Size Uploaded Provenance Actions
augplot-0.3.0.tar.gz 4.5 MB With provenance Details for augplot-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for augplot 0.3.0
File Interpreter ABI Platform Actions
augplot-0.3.0-py3-none-any.whl Python 3 none any Details for augplot-0.3.0-py3-none-any.whl

Total release size: 4.6 MB

Release files / augplot-0.3.0.tar.gz

Download URL augplot-0.3.0.tar.gz
Size 4.5 MB
Tags Source
SHA-256 checksum
How to use checksums
79b45db84cb6924a5727195d432b1a0c4f8e2d42ddea4e80dd2e30c3a7962106
BLAKE2b-256 checksum
How to use checksums
08c5068d410e8c601e7f6f1a4730333d2082ee21c2114d3060e4360729728008
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 20, 2026.

Transparency log

Release files / augplot-0.3.0-py3-none-any.whl

Download URL augplot-0.3.0-py3-none-any.whl
Size 54.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0fc1d98c81a61610937438299362272b67c2836bd6b723dcb71130403361a301
BLAKE2b-256 checksum
How to use checksums
f8652712ae081ea0d14f9a52eafd985cd7934396c4e0e89fc7a24172a0fcf28f
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 20, 2026.

Transparency log

Security for augplot 0.3.0

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for augplot-0.3.0.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 20, 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