ChartJS Python integration
Project description
pydacharts
Pydantic :heart: chartjs This is a code generator for ChartJS configuration JSON.
Set Up
- Pip install the package with
pip install pydacharts
or clone the repo - Use the class generator to write a "config" file. One simple example
from pydacharts.models import Config, Data, Dataset
def spending_by_year_chartjs() -> Config:
"""
Return a chartjs "config" object for sip dataset
charting
"""
return Config(
type="bar",
data=Data(
labels=["Green is nice", "Red is angry", "Blue is calming"],
datasets=[Dataset(
backgroundColor = ["green", "red", "blue"],
data = [1,2,3],
label = "We love colors"
)]
)
)
(This example should work standalone)
For running examples
Run Examples
pip install flask
cd serve
flask run
go to localhost:5000
Building
poetry build
poetry version patch # or "major", "minor"
poetry publish
Developing
Clone in editable
mode
pip install -e git+git://github.com/joshbrooks/pydacharts/#egg=pydacharts
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pydacharts-0.1.0.tar.gz
(105.7 kB
view hashes)
Built Distribution
pydacharts-0.1.0-py3-none-any.whl
(14.2 kB
view hashes)
Close
Hashes for pydacharts-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c61e7485643766a238ea3c1ed21802b0fe6814b3b56958fcc2248ea4a49362f |
|
MD5 | fcf9c0eea25562082a40f91288fda9d3 |
|
BLAKE2b-256 | ba17831eda2f3b77cf3a1c3ec09d241c666449b30dd9ef86e15b836c8102f9e1 |