Registry / serialization / datawrapper

datawrapper

JSON →
library2.0.17pypypi✓ verified 85d ago

A lightweight Python wrapper for the Datawrapper API, supporting chart creation, data upload, publishing, and export. Current version 2.0.16, requires Python >=3.10. Active development with frequent releases.

pip install datawrapper
INSTALL
IMPORT
SIG · DATAWRAPPER
D
datawrapper
serializationpythonv2.0.17
Install
13.3s avg
Import
3475ms
Disk
237MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.0.17 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 3.608s · 244.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 13.3s · import 3.342s · 236MB
237MB installed
● package 237MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Datawrapper
from datawrapper import Datawrapper
from datawrapper import DatawrapperAPI
No such class; the main class is Datawrapper.

Initialize the client with API token and create a simple bar chart.

from datawrapper import Datawrapper dw = Datawrapper(access_token=os.environ.get('DW_ACCESS_TOKEN', '')) chart = dw.create_chart(title='Test Chart', chart_type='d3-bars') print(chart['id'])
Debug
Known issues
breakingv2.0.0 changed the API completely. Old code using version 1.x is not compatible.
fix
Migrate to new constructor: Datawrapper(access_token='...') and use methods like create_chart, add_data, publish_chart.
affects: >=2.0.0
gotchaThe chart_id parameter in move_chart changed from int to str in v2.0.13.
fix
Always pass chart_id as a string, not an integer.
affects: >=2.0.13
gotchaExport methods (export_png, export_pdf, export_svg) have simplified parameters in v2.0.15; older parameter names may break.
fix
Check the new signature: export_png(chart_id, unit='px', width=800) etc. Remove deprecated parameters like 'full_vector'.
affects: >=2.0.15
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'datawrapper'
The package is installed under the name 'datawrapper' but imported as 'datawrapper' (correct). If you see this, the package is not installed.
fix
Run: pip install datawrapper
TypeError: 'NoneType' object is not subscriptable
A method returned None because of an invalid chart_id or missing data.
fix
Verify that the chart exists and that you have provided valid data using add_data() before calling export or publish.
datawrapper.core.DatawrapperError: 401 - Unauthorized
Invalid or missing API access token.
fix
Set the DW_ACCESS_TOKEN environment variable or pass it to the constructor: Datawrapper(access_token='your_token_here')
AttributeError: module 'datawrapper' has no attribute 'Datawrapper'
Importing incorrectly. The class is directly under the 'datawrapper' module.
fix
Use: from datawrapper import Datawrapper
Upgrade
Version history
2.0.17latest on PyPI · released May 29, 2026
Audit
Dependencies
httpxrequiredHTTP client for API requests
pydanticrequiredData validation and settings management
pandasoptionalOptional for data frame handling
Agent activity
11 hits · last 30 days
node
10
OpenAI (training)
1
Resources
datawrapper — pip install datawrapper · libregistry