Metadata-Version: 2.3
Name: pydacharts
Version: 0.2.0.dev2
Summary: ChartJS Python integration
Author-email: Josh Brooks <josh@catalpa.io>, Roberto Maurizzi <roberto@catalpa.io>
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Software Development :: Build Tools
Requires-Python: >=3.11
Requires-Dist: pydantic
Provides-Extra: serve
Requires-Dist: flask>=3.0.3; extra == 'serve'
Description-Content-Type: text/markdown

# pydacharts

Pydantic :heart: chartjs
This is a code generator for [ChartJS](https://www.chartjs.org) configuration JSON.

## Set Up

1. Pip install the package with `pip install pydacharts`, `uv add pydacharts`, or clone the repo
2. Use the class generator to write a "config" file. One simple example

```py
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

```bash
uv sync --extra serve
cd serve
flask run
```

go to localhost:5000

### Building

Update the `version` field in `pyproject.toml`
Create a git tag same as the version


```bash
uv build
uv publish --token pypi-YOURTOKENHERE
```
