{"id":23516,"library":"datawrapper","title":"Datawrapper Python Wrapper","description":"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.","status":"active","version":"2.0.16","language":"python","source_language":"en","source_url":"https://github.com/chekos/datawrapper","tags":["api-client","datawrapper","charts","visualization","wrapper"],"install":[{"cmd":"pip install datawrapper","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"HTTP client for API requests","package":"httpx","optional":false},{"reason":"Data validation and settings management","package":"pydantic","optional":false},{"reason":"Optional for data frame handling","package":"pandas","optional":true}],"imports":[{"note":"No such class; the main class is Datawrapper.","wrong":"from datawrapper import DatawrapperAPI","symbol":"Datawrapper","correct":"from datawrapper import Datawrapper"}],"quickstart":{"code":"from datawrapper import Datawrapper\ndw = Datawrapper(access_token=os.environ.get('DW_ACCESS_TOKEN', ''))\nchart = dw.create_chart(title='Test Chart', chart_type='d3-bars')\nprint(chart['id'])","lang":"python","description":"Initialize the client with API token and create a simple bar chart."},"warnings":[{"fix":"Migrate to new constructor: Datawrapper(access_token='...') and use methods like create_chart, add_data, publish_chart.","message":"v2.0.0 changed the API completely. Old code using version 1.x is not compatible.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Always pass chart_id as a string, not an integer.","message":"The chart_id parameter in move_chart changed from int to str in v2.0.13.","severity":"gotcha","affected_versions":">=2.0.13"},{"fix":"Check the new signature: export_png(chart_id, unit='px', width=800) etc. Remove deprecated parameters like 'full_vector'.","message":"Export methods (export_png, export_pdf, export_svg) have simplified parameters in v2.0.15; older parameter names may break.","severity":"gotcha","affected_versions":">=2.0.15"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run: pip install datawrapper","cause":"The package is installed under the name 'datawrapper' but imported as 'datawrapper' (correct). If you see this, the package is not installed.","error":"ModuleNotFoundError: No module named 'datawrapper'"},{"fix":"Verify that the chart exists and that you have provided valid data using add_data() before calling export or publish.","cause":"A method returned None because of an invalid chart_id or missing data.","error":"TypeError: 'NoneType' object is not subscriptable"},{"fix":"Set the DW_ACCESS_TOKEN environment variable or pass it to the constructor: Datawrapper(access_token='your_token_here')","cause":"Invalid or missing API access token.","error":"datawrapper.core.DatawrapperError: 401 - Unauthorized"},{"fix":"Use: from datawrapper import Datawrapper","cause":"Importing incorrectly. The class is directly under the 'datawrapper' module.","error":"AttributeError: module 'datawrapper' has no attribute 'Datawrapper'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}