gviz-api is a helper Python library for developers implementing data sources for visualizations built on the Google Visualization API. It allows for creating `DataTable` objects in Python and serializing them into JSON string, JSON response, or JavaScript string formats consumable by client-side Google Charts. The current version is 1.10.0, released in October 2021, and the project appears to be stable but not frequently updated.
pip install gviz-apiVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to define a table schema, populate it with data, and output the `DataTable` in different formats (JSON, JSON Response, JavaScript string) suitable for consumption by Google Charts.
While functional for its intended purpose, users should be aware that active feature development or frequent bug fixes may not be available. Consider community forks or alternative solutions for new requirements.
Ensure all data elements conform exactly to their declared Python types before appending to the `DataTable`. For example, use `int(value)` or `float(value)` explicitly for numeric conversions.
Plan your table schema carefully before initialization. If dynamic column modification or individual row deletion is needed, preprocess your data into the final desired structure before creating the `DataTable`.
You must include the Google Charts JavaScript library in your web page and write JavaScript code to fetch the data generated by `gviz-api` and draw the desired visualization.
Install the library using pip: `pip install gviz-api`. Ensure your import statement is `import gviz_api`.
Ensure all data elements conform exactly to their declared Python types before appending to the `DataTable`. Explicitly convert values using functions like `int()`, `float()`, `str()`, or `datetime.date()` as needed.
Review the `table_description` dictionary passed to the `gviz_api.DataTable` constructor, ensuring column definitions are correct and that subsequent `AppendData()` calls provide rows matching this schema.
Check that the `gviz_api.DataTable` object and any intermediate results are correctly instantiated and populated with valid data before attempting to call methods or access attributes on them.
No dependency data recorded yet.