Registry / http-networking / quickchart-io

quickchart-io

JSON →
library2.0.0pypypi✓ verified 87d ago

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.

pip install quickchart-io
INSTALL
IMPORT
SIG · QUICKCHART-IO
Q
quickchart-io
http-networkingpythonv2.0.0
Install
2.1s avg
Import
17ms
Disk
19MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v2.0.0 · 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.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.018s · 21MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 2.1s · import 0.016s · 21MB
19MB installed
● package 19MB
Code
Verified usage

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

QuickChart
✓ from quickchart import QuickChart
✗ import quickchart
The correct import is from quickchart import QuickChart; importing the module directly does not expose the class.

Create a bar chart image URL. For authenticated users, set QUICKCHART_API_KEY environment variable.

from quickchart import QuickChart import os api_key = os.environ.get('QUICKCHART_API_KEY', '') qc = QuickChart(api_key=api_key) qc.width = 600 qc.height = 400 qc.device_pixel_ratio = 2.0 qc.config = { "type": "bar", "data": { "labels": ["Q1", "Q2", "Q3", "Q4"], "datasets": [{ "label": "Sales", "data": [50, 60, 70, 80] }] } } url = qc.get_url() print(f"Chart URL: {url}") # To get binary image data: img_bytes = qc.get_bytes()
Debug
Known issues
breakingUpgrading from v1.x to v2.0.0 drops Python 2 and Python < 3.7 support. Existing code using Python 2 will break.
fix
Upgrade to Python 3.7+ and install quickchart-io>=2.0.0.
affects: >=2.0.0
gotchaWhen 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.
fix
Wrap JavaScript functions as strings using `'function() { ... }'` or use `qc.set_config` with a properly escaped config dictionary.
affects: all
deprecatedThe `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.
fix
Use `QuickChart(host='https://quickchart.io')` (string with protocol) or separate `scheme` and `host` kwargs.
affects: >=2.0.0
Errors
Common errors & fixes
TypeError: __init__() got an unexpected keyword argument 'api_key'
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.
fix
Upgrade to latest version: `pip install --upgrade quickchart-io`
AttributeError: 'QuickChart' object has no attribute 'get_url'
The method might be named differently in older versions or the import is incorrect.
fix
Ensure you have version >=1.0.1 and use the correct import: `from quickchart import QuickChart`
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Usually an invalid API key or hitting the rate limit without an API key. The server returns a non-JSON error.
fix
Set a valid API key via environment variable or check usage limits. Also verify the chart config is valid JSON.
Upgrade
Version history
2.0.0latest on PyPI · released Sep 24, 2022
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
10
Resources
quickchart-io — pip install quickchart-io · libregistry