{"id":24500,"library":"quickchart-io","title":"quickchart-io","description":"A Python client for quickchart.io, a web service that generates static chart images from Chart.js definitions. Current version 2.0.0 requires Python >=3.7. The library sends JSON chart specifications to the QuickChart API and returns PNG/JPEG/SVG images. Major update v2.0.0 dropped Python 2 and Python <3.7 support. Released as needed.","status":"active","version":"2.0.0","language":"python","source_language":"en","source_url":"https://github.com/typpo/quickchart-python","tags":["charts","image-generation","chart.js","quickchart","data-visualization"],"install":[{"cmd":"pip install quickchart-io","lang":"bash","label":"PyPI install"}],"dependencies":[],"imports":[{"note":"The correct import is from quickchart import QuickChart; importing the module directly does not expose the class.","wrong":"import quickchart","symbol":"QuickChart","correct":"from quickchart import QuickChart"}],"quickstart":{"code":"from quickchart import QuickChart\n\nimport os\n\napi_key = os.environ.get('QUICKCHART_API_KEY', '')\n\nqc = QuickChart(api_key=api_key)\nqc.width = 600\nqc.height = 400\nqc.device_pixel_ratio = 2.0\nqc.config = {\n    \"type\": \"bar\",\n    \"data\": {\n        \"labels\": [\"Q1\", \"Q2\", \"Q3\", \"Q4\"],\n        \"datasets\": [{\n            \"label\": \"Sales\",\n            \"data\": [50, 60, 70, 80]\n        }]\n    }\n}\nurl = qc.get_url()\nprint(f\"Chart URL: {url}\")\n# To get binary image data: img_bytes = qc.get_bytes()","lang":"python","description":"Create a bar chart image URL. For authenticated users, set QUICKCHART_API_KEY environment variable."},"warnings":[{"fix":"Upgrade to Python 3.7+ and install quickchart-io>=2.0.0.","message":"Upgrading from v1.x to v2.0.0 drops Python 2 and Python < 3.7 support. Existing code using Python 2 will break.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Wrap JavaScript functions as strings using `'function() { ... }'` or use `qc.set_config` with a properly escaped config dictionary.","message":"When using chart configurations with JavaScript functions (e.g., tooltips, custom axes callbacks), the v2 library may not correctly serialize JavaScript functions. Use `qc.set_config` or pass a raw string for the config if functions are required.","severity":"gotcha","affected_versions":"all"},{"fix":"Use `QuickChart(host='https://quickchart.io')` (string with protocol) or separate `scheme` and `host` kwargs.","message":"The `QuickChart` parameter `host` is deprecated in v2.0.0 in favor of `scheme` and `host` as separate parameters or using the constructor's `host` parameter.","severity":"deprecated","affected_versions":">=2.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Upgrade to latest version: `pip install --upgrade quickchart-io`","cause":"Old version v1.x (or very early v2 alpha) did not accept api_key as a constructor argument. The stable v2.0.0 api_key parameter was added.","error":"TypeError: __init__() got an unexpected keyword argument 'api_key'"},{"fix":"Ensure you have version >=1.0.1 and use the correct import: `from quickchart import QuickChart`","cause":"The method might be named differently in older versions or the import is incorrect.","error":"AttributeError: 'QuickChart' object has no attribute 'get_url'"},{"fix":"Set a valid API key via environment variable or check usage limits. Also verify the chart config is valid JSON.","cause":"Usually an invalid API key or hitting the rate limit without an API key. The server returns a non-JSON error.","error":"requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}