A lightweight Python wrapper for the Datawrapper API
Maintained. Last release 4 months ago, commits in 3 of the last 26 weeks. Weaker on commit activity and contributor spread.
pip install datawrapperdatawrapper
A lightweight Python wrapper for the Datawrapper API
Features
- Create, get, update, export and delete charts, tables and maps
- Add data from a
pandas.DataFrameor a GeoJSON file with one simple call - Get, update and delete folders, users and teams.
- Retrieve lists of recently edited and updated charts
- Access metadata about your account
Installation
# With `uv` ...
uv add datawrapper
# or, if you prefer...
pip install datawrapper
Quick Start
Create beautiful charts with type-safe, object-oriented Python:
import pandas as pd
import datawrapper as dw
# Configure a bar chart
chart = dw.BarChart(
title="Top Programming Languages 2024",
data=pd.DataFrame(
{"Language": ["Python", "JavaScript", "Java"], "Users": [45.3, 38.2, 30.5]}
),
axis_label_format=dw.NumberFormat.ONE_DECIMAL,
)
# Create and publish (uses DATAWRAPPER_ACCESS_TOKEN environment variable)
chart.create()
chart.publish()
See the full documentation for comprehensive guides on all chart types.
Contributing
Clone the repository and install the locked development dependencies.
uv sync --frozen --all-extras
Install pre-commit to run a battery of automatic quick fixes against your work.
uv run pre-commit install
Run the canonical local checks before opening a pull request.
uv run ruff check ./datawrapper ./tests
uv run ruff format --check ./datawrapper ./tests
uv run mypy ./datawrapper --ignore-missing-imports
uv run pytest
uv build --sdist --wheel
See CONTRIBUTING.md for the full workflow. AI agents should also read AGENTS.md before changing files.
📈 Releases
You can see the list of available releases on the GitHub Releases page.
We follow Semantic Versions specification. When you're ready to make a new release, visit the releases page and create a new entry. Set the tags and press publish. That will trigger a GitHub Action that automatically deploys the code to the Python Package Index.