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 datawrapperVerified import paths — ran on the pinned version, not inferred.
Initialize the client with API token and create a simple bar chart.
Migrate to new constructor: Datawrapper(access_token='...') and use methods like create_chart, add_data, publish_chart.
Always pass chart_id as a string, not an integer.
Check the new signature: export_png(chart_id, unit='px', width=800) etc. Remove deprecated parameters like 'full_vector'.
Run: pip install datawrapper
Verify that the chart exists and that you have provided valid data using add_data() before calling export or publish.
Set the DW_ACCESS_TOKEN environment variable or pass it to the constructor: Datawrapper(access_token='your_token_here')
Use: from datawrapper import Datawrapper