Skip to main content

No project description provided

Project description

pydacharts

Pydantic :heart: chartjs This is a code generator for ChartJS configuration JSON.

Set Up

  1. Pip install the package with pip install pydacharts or clone the repo
  2. 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


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.4.tar.gz (23.9 kB view hashes)

Uploaded Source

Built Distribution

pydacharts-0.1.4-py3-none-any.whl (25.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page