dashml-lang 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- dashml_lang-0.1.0/LICENSE +21 -0
- dashml_lang-0.1.0/PKG-INFO +140 -0
- dashml_lang-0.1.0/README.md +94 -0
- dashml_lang-0.1.0/dashml_lang.egg-info/PKG-INFO +140 -0
- dashml_lang-0.1.0/dashml_lang.egg-info/SOURCES.txt +35 -0
- dashml_lang-0.1.0/dashml_lang.egg-info/dependency_links.txt +1 -0
- dashml_lang-0.1.0/dashml_lang.egg-info/entry_points.txt +2 -0
- dashml_lang-0.1.0/dashml_lang.egg-info/requires.txt +23 -0
- dashml_lang-0.1.0/dashml_lang.egg-info/top_level.txt +1 -0
- dashml_lang-0.1.0/dashml_new/__init__.py +11 -0
- dashml_lang-0.1.0/dashml_new/app.py +39 -0
- dashml_lang-0.1.0/dashml_new/cli.py +643 -0
- dashml_lang-0.1.0/dashml_new/core/__init__.py +24 -0
- dashml_lang-0.1.0/dashml_new/core/engine.py +42 -0
- dashml_lang-0.1.0/dashml_new/core/normalizer.py +396 -0
- dashml_lang-0.1.0/dashml_new/core/parser.py +43 -0
- dashml_lang-0.1.0/dashml_new/core/types.py +256 -0
- dashml_lang-0.1.0/dashml_new/core/validator.py +517 -0
- dashml_lang-0.1.0/dashml_new/core/watcher.py +98 -0
- dashml_lang-0.1.0/dashml_new/generate_startup_data.py +127 -0
- dashml_lang-0.1.0/dashml_new/get_chart.py +39 -0
- dashml_lang-0.1.0/dashml_new/inspect_dashboard.py +118 -0
- dashml_lang-0.1.0/dashml_new/transformers/__init__.py +7 -0
- dashml_lang-0.1.0/dashml_new/transformers/base.py +131 -0
- dashml_lang-0.1.0/dashml_new/transformers/constants.py +442 -0
- dashml_lang-0.1.0/dashml_new/transformers/grafana.py +1179 -0
- dashml_lang-0.1.0/dashml_new/transformers/observable.py +2737 -0
- dashml_lang-0.1.0/dashml_new/transformers/plotly.py +2855 -0
- dashml_lang-0.1.0/dashml_new/transformers/registry.py +96 -0
- dashml_lang-0.1.0/dashml_new/transformers/secrets.py +256 -0
- dashml_lang-0.1.0/dashml_new/transformers/streamlit.py +1175 -0
- dashml_lang-0.1.0/dashml_new/transformers/superset.py +1668 -0
- dashml_lang-0.1.0/dashml_new/transformers/vegalite.py +1013 -0
- dashml_lang-0.1.0/pyproject.toml +86 -0
- dashml_lang-0.1.0/setup.cfg +4 -0
- dashml_lang-0.1.0/tests/test_normalizer.py +189 -0
- dashml_lang-0.1.0/tests/test_validator.py +830 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Dawid Olejniczak, Szymon Nowaczyk
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: dashml-lang
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Declarative YAML-based compiler for data visualization dashboards. Write your dashboard once, compile to Streamlit, Plotly, Observable Plot, Apache Superset, Vega-Lite, or Grafana.
|
|
5
|
+
Author: Dawid Olejniczak, Szymon Nowaczyk
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/dashml-dev/dashml
|
|
8
|
+
Project-URL: Repository, https://github.com/dashml-dev/dashml
|
|
9
|
+
Project-URL: Issues, https://github.com/dashml-dev/dashml/issues
|
|
10
|
+
Keywords: dashboard,visualization,dsl,declarative,compiler,yaml,streamlit,plotly,observable-plot,vega-lite,grafana,superset,bigquery,business-intelligence
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Intended Audience :: Information Technology
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering :: Visualization
|
|
22
|
+
Classifier: Topic :: Software Development :: Code Generators
|
|
23
|
+
Classifier: Topic :: Software Development :: Compilers
|
|
24
|
+
Requires-Python: >=3.9
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
License-File: LICENSE
|
|
27
|
+
Requires-Dist: pyyaml>=6.0
|
|
28
|
+
Provides-Extra: streamlit
|
|
29
|
+
Requires-Dist: streamlit>=1.40.0; extra == "streamlit"
|
|
30
|
+
Requires-Dist: pandas>=2.0.0; extra == "streamlit"
|
|
31
|
+
Requires-Dist: altair>=5.0.0; extra == "streamlit"
|
|
32
|
+
Requires-Dist: watchdog>=4.0.0; extra == "streamlit"
|
|
33
|
+
Provides-Extra: sql
|
|
34
|
+
Requires-Dist: flask>=3.0.0; extra == "sql"
|
|
35
|
+
Requires-Dist: sqlalchemy>=2.0.0; extra == "sql"
|
|
36
|
+
Requires-Dist: psycopg2-binary>=2.9.0; extra == "sql"
|
|
37
|
+
Provides-Extra: bigquery
|
|
38
|
+
Requires-Dist: flask>=3.0.0; extra == "bigquery"
|
|
39
|
+
Requires-Dist: google-cloud-bigquery>=3.0.0; extra == "bigquery"
|
|
40
|
+
Provides-Extra: superset
|
|
41
|
+
Requires-Dist: requests>=2.32.0; extra == "superset"
|
|
42
|
+
Provides-Extra: dev
|
|
43
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
44
|
+
Requires-Dist: build>=1.0.0; extra == "dev"
|
|
45
|
+
Dynamic: license-file
|
|
46
|
+
|
|
47
|
+
# DashML
|
|
48
|
+
|
|
49
|
+
A declarative language for data visualization dashboards that compiles to multiple platforms.
|
|
50
|
+
|
|
51
|
+
Write your dashboard spec once in `.dashml` format, then compile it to **Streamlit**, **Plotly**, **Observable Plot**, **Apache Superset**, **Vega-Lite**, or **Grafana**.
|
|
52
|
+
|
|
53
|
+
## Quick Start
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# Generate a Streamlit app
|
|
57
|
+
python -m dashml_new.cli build dashboard.dashml --target streamlit --output app_dir
|
|
58
|
+
streamlit run app_dir/app.py
|
|
59
|
+
|
|
60
|
+
# Generate a standalone Plotly HTML dashboard
|
|
61
|
+
python -m dashml_new.cli build dashboard.dashml --target plotly --output dashboard.html
|
|
62
|
+
|
|
63
|
+
# Generate an Observable Plot HTML dashboard
|
|
64
|
+
python -m dashml_new.cli build dashboard.dashml --target observable --output dashboard.html
|
|
65
|
+
|
|
66
|
+
# Generate a Vega-Lite JSON specification
|
|
67
|
+
python -m dashml_new.cli build dashboard.dashml --target vegalite --output dashboard.json
|
|
68
|
+
|
|
69
|
+
# Generate a Grafana dashboard JSON
|
|
70
|
+
python -m dashml_new.cli build dashboard.dashml --target grafana --output dashboard.json
|
|
71
|
+
|
|
72
|
+
# Create a dashboard directly in Apache Superset
|
|
73
|
+
python -m dashml_new.cli build dashboard.dashml --target superset \
|
|
74
|
+
--superset-user admin --superset-password admin
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Database credentials
|
|
78
|
+
|
|
79
|
+
For SQL or BigQuery data sources, the generated artifact reads connection
|
|
80
|
+
parameters from environment variables at runtime — never from baked-in literals.
|
|
81
|
+
The generator emits `.env.example`, `.gitignore`, and `SECRETS.md` next to the
|
|
82
|
+
generated `app.py`. Copy `.env.example` to `.env`, fill in the values, and run.
|
|
83
|
+
The same artifact directory is safe to commit to a public repository.
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
python -m dashml_new.cli build dashboard.dashml --target plotly --output app_dir
|
|
87
|
+
cd app_dir
|
|
88
|
+
cp .env.example .env # edit .env, set DASHML_DB_PASSWORD etc.
|
|
89
|
+
python app.py # reads from env (or .env via python-dotenv)
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
See `SECRETS.md` in any generated SQL/BigQuery artifact for the full list of
|
|
93
|
+
environment variables and recommended deployment patterns (Docker, Kubernetes,
|
|
94
|
+
systemd, CI/CD, GCP Workload Identity).
|
|
95
|
+
|
|
96
|
+
## Example
|
|
97
|
+
|
|
98
|
+
```yaml
|
|
99
|
+
version: 0.1
|
|
100
|
+
title: "Sales Dashboard"
|
|
101
|
+
style: "styles/dracula.dmls"
|
|
102
|
+
|
|
103
|
+
data:
|
|
104
|
+
type: csv
|
|
105
|
+
path: "data/sales.csv"
|
|
106
|
+
|
|
107
|
+
charts:
|
|
108
|
+
- id: "sales_by_country"
|
|
109
|
+
type: "bar"
|
|
110
|
+
title: "Sales by Country"
|
|
111
|
+
x: "country"
|
|
112
|
+
y: "sales"
|
|
113
|
+
agg: "sum"
|
|
114
|
+
sort: "y"
|
|
115
|
+
sort_order: "desc"
|
|
116
|
+
limit: 10
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Documentation
|
|
120
|
+
|
|
121
|
+
- **[User Guide](dashml_new/README.md)** - Full specification reference, chart types, CLI, themes
|
|
122
|
+
- **[Architecture](ARCHITECTURE.md)** - System design, compiler pipeline, type system
|
|
123
|
+
|
|
124
|
+
## Key Concepts
|
|
125
|
+
|
|
126
|
+
- **Compiler, not runtime** - DashML generates standalone code; it never loads or touches your data
|
|
127
|
+
- **Credentials never baked** - generated SQL/BigQuery artifacts read database credentials from environment variables at runtime; safe to version-control
|
|
128
|
+
- **12 chart types** - bar, line, scatter, pie, area, histogram, stacked_bar, grouped_bar, bubble, heatmap, box, geo
|
|
129
|
+
- **3 data sources** - CSV, SQL (PostgreSQL/MySQL/SQLite), Google BigQuery
|
|
130
|
+
- **6 backends** - Streamlit, Plotly, Observable Plot, Apache Superset, Vega-Lite, Grafana
|
|
131
|
+
- **6 built-in themes** - Dracula, Nord, Gruvbox, Monokai, One Dark, Solarized Light
|
|
132
|
+
|
|
133
|
+
## Authors
|
|
134
|
+
|
|
135
|
+
- Dawid Olejniczak
|
|
136
|
+
- Szymon Nowaczyk
|
|
137
|
+
|
|
138
|
+
## License
|
|
139
|
+
|
|
140
|
+
MIT
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# DashML
|
|
2
|
+
|
|
3
|
+
A declarative language for data visualization dashboards that compiles to multiple platforms.
|
|
4
|
+
|
|
5
|
+
Write your dashboard spec once in `.dashml` format, then compile it to **Streamlit**, **Plotly**, **Observable Plot**, **Apache Superset**, **Vega-Lite**, or **Grafana**.
|
|
6
|
+
|
|
7
|
+
## Quick Start
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# Generate a Streamlit app
|
|
11
|
+
python -m dashml_new.cli build dashboard.dashml --target streamlit --output app_dir
|
|
12
|
+
streamlit run app_dir/app.py
|
|
13
|
+
|
|
14
|
+
# Generate a standalone Plotly HTML dashboard
|
|
15
|
+
python -m dashml_new.cli build dashboard.dashml --target plotly --output dashboard.html
|
|
16
|
+
|
|
17
|
+
# Generate an Observable Plot HTML dashboard
|
|
18
|
+
python -m dashml_new.cli build dashboard.dashml --target observable --output dashboard.html
|
|
19
|
+
|
|
20
|
+
# Generate a Vega-Lite JSON specification
|
|
21
|
+
python -m dashml_new.cli build dashboard.dashml --target vegalite --output dashboard.json
|
|
22
|
+
|
|
23
|
+
# Generate a Grafana dashboard JSON
|
|
24
|
+
python -m dashml_new.cli build dashboard.dashml --target grafana --output dashboard.json
|
|
25
|
+
|
|
26
|
+
# Create a dashboard directly in Apache Superset
|
|
27
|
+
python -m dashml_new.cli build dashboard.dashml --target superset \
|
|
28
|
+
--superset-user admin --superset-password admin
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Database credentials
|
|
32
|
+
|
|
33
|
+
For SQL or BigQuery data sources, the generated artifact reads connection
|
|
34
|
+
parameters from environment variables at runtime — never from baked-in literals.
|
|
35
|
+
The generator emits `.env.example`, `.gitignore`, and `SECRETS.md` next to the
|
|
36
|
+
generated `app.py`. Copy `.env.example` to `.env`, fill in the values, and run.
|
|
37
|
+
The same artifact directory is safe to commit to a public repository.
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
python -m dashml_new.cli build dashboard.dashml --target plotly --output app_dir
|
|
41
|
+
cd app_dir
|
|
42
|
+
cp .env.example .env # edit .env, set DASHML_DB_PASSWORD etc.
|
|
43
|
+
python app.py # reads from env (or .env via python-dotenv)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
See `SECRETS.md` in any generated SQL/BigQuery artifact for the full list of
|
|
47
|
+
environment variables and recommended deployment patterns (Docker, Kubernetes,
|
|
48
|
+
systemd, CI/CD, GCP Workload Identity).
|
|
49
|
+
|
|
50
|
+
## Example
|
|
51
|
+
|
|
52
|
+
```yaml
|
|
53
|
+
version: 0.1
|
|
54
|
+
title: "Sales Dashboard"
|
|
55
|
+
style: "styles/dracula.dmls"
|
|
56
|
+
|
|
57
|
+
data:
|
|
58
|
+
type: csv
|
|
59
|
+
path: "data/sales.csv"
|
|
60
|
+
|
|
61
|
+
charts:
|
|
62
|
+
- id: "sales_by_country"
|
|
63
|
+
type: "bar"
|
|
64
|
+
title: "Sales by Country"
|
|
65
|
+
x: "country"
|
|
66
|
+
y: "sales"
|
|
67
|
+
agg: "sum"
|
|
68
|
+
sort: "y"
|
|
69
|
+
sort_order: "desc"
|
|
70
|
+
limit: 10
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Documentation
|
|
74
|
+
|
|
75
|
+
- **[User Guide](dashml_new/README.md)** - Full specification reference, chart types, CLI, themes
|
|
76
|
+
- **[Architecture](ARCHITECTURE.md)** - System design, compiler pipeline, type system
|
|
77
|
+
|
|
78
|
+
## Key Concepts
|
|
79
|
+
|
|
80
|
+
- **Compiler, not runtime** - DashML generates standalone code; it never loads or touches your data
|
|
81
|
+
- **Credentials never baked** - generated SQL/BigQuery artifacts read database credentials from environment variables at runtime; safe to version-control
|
|
82
|
+
- **12 chart types** - bar, line, scatter, pie, area, histogram, stacked_bar, grouped_bar, bubble, heatmap, box, geo
|
|
83
|
+
- **3 data sources** - CSV, SQL (PostgreSQL/MySQL/SQLite), Google BigQuery
|
|
84
|
+
- **6 backends** - Streamlit, Plotly, Observable Plot, Apache Superset, Vega-Lite, Grafana
|
|
85
|
+
- **6 built-in themes** - Dracula, Nord, Gruvbox, Monokai, One Dark, Solarized Light
|
|
86
|
+
|
|
87
|
+
## Authors
|
|
88
|
+
|
|
89
|
+
- Dawid Olejniczak
|
|
90
|
+
- Szymon Nowaczyk
|
|
91
|
+
|
|
92
|
+
## License
|
|
93
|
+
|
|
94
|
+
MIT
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: dashml-lang
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Declarative YAML-based compiler for data visualization dashboards. Write your dashboard once, compile to Streamlit, Plotly, Observable Plot, Apache Superset, Vega-Lite, or Grafana.
|
|
5
|
+
Author: Dawid Olejniczak, Szymon Nowaczyk
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/dashml-dev/dashml
|
|
8
|
+
Project-URL: Repository, https://github.com/dashml-dev/dashml
|
|
9
|
+
Project-URL: Issues, https://github.com/dashml-dev/dashml/issues
|
|
10
|
+
Keywords: dashboard,visualization,dsl,declarative,compiler,yaml,streamlit,plotly,observable-plot,vega-lite,grafana,superset,bigquery,business-intelligence
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Intended Audience :: Information Technology
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering :: Visualization
|
|
22
|
+
Classifier: Topic :: Software Development :: Code Generators
|
|
23
|
+
Classifier: Topic :: Software Development :: Compilers
|
|
24
|
+
Requires-Python: >=3.9
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
License-File: LICENSE
|
|
27
|
+
Requires-Dist: pyyaml>=6.0
|
|
28
|
+
Provides-Extra: streamlit
|
|
29
|
+
Requires-Dist: streamlit>=1.40.0; extra == "streamlit"
|
|
30
|
+
Requires-Dist: pandas>=2.0.0; extra == "streamlit"
|
|
31
|
+
Requires-Dist: altair>=5.0.0; extra == "streamlit"
|
|
32
|
+
Requires-Dist: watchdog>=4.0.0; extra == "streamlit"
|
|
33
|
+
Provides-Extra: sql
|
|
34
|
+
Requires-Dist: flask>=3.0.0; extra == "sql"
|
|
35
|
+
Requires-Dist: sqlalchemy>=2.0.0; extra == "sql"
|
|
36
|
+
Requires-Dist: psycopg2-binary>=2.9.0; extra == "sql"
|
|
37
|
+
Provides-Extra: bigquery
|
|
38
|
+
Requires-Dist: flask>=3.0.0; extra == "bigquery"
|
|
39
|
+
Requires-Dist: google-cloud-bigquery>=3.0.0; extra == "bigquery"
|
|
40
|
+
Provides-Extra: superset
|
|
41
|
+
Requires-Dist: requests>=2.32.0; extra == "superset"
|
|
42
|
+
Provides-Extra: dev
|
|
43
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
44
|
+
Requires-Dist: build>=1.0.0; extra == "dev"
|
|
45
|
+
Dynamic: license-file
|
|
46
|
+
|
|
47
|
+
# DashML
|
|
48
|
+
|
|
49
|
+
A declarative language for data visualization dashboards that compiles to multiple platforms.
|
|
50
|
+
|
|
51
|
+
Write your dashboard spec once in `.dashml` format, then compile it to **Streamlit**, **Plotly**, **Observable Plot**, **Apache Superset**, **Vega-Lite**, or **Grafana**.
|
|
52
|
+
|
|
53
|
+
## Quick Start
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# Generate a Streamlit app
|
|
57
|
+
python -m dashml_new.cli build dashboard.dashml --target streamlit --output app_dir
|
|
58
|
+
streamlit run app_dir/app.py
|
|
59
|
+
|
|
60
|
+
# Generate a standalone Plotly HTML dashboard
|
|
61
|
+
python -m dashml_new.cli build dashboard.dashml --target plotly --output dashboard.html
|
|
62
|
+
|
|
63
|
+
# Generate an Observable Plot HTML dashboard
|
|
64
|
+
python -m dashml_new.cli build dashboard.dashml --target observable --output dashboard.html
|
|
65
|
+
|
|
66
|
+
# Generate a Vega-Lite JSON specification
|
|
67
|
+
python -m dashml_new.cli build dashboard.dashml --target vegalite --output dashboard.json
|
|
68
|
+
|
|
69
|
+
# Generate a Grafana dashboard JSON
|
|
70
|
+
python -m dashml_new.cli build dashboard.dashml --target grafana --output dashboard.json
|
|
71
|
+
|
|
72
|
+
# Create a dashboard directly in Apache Superset
|
|
73
|
+
python -m dashml_new.cli build dashboard.dashml --target superset \
|
|
74
|
+
--superset-user admin --superset-password admin
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Database credentials
|
|
78
|
+
|
|
79
|
+
For SQL or BigQuery data sources, the generated artifact reads connection
|
|
80
|
+
parameters from environment variables at runtime — never from baked-in literals.
|
|
81
|
+
The generator emits `.env.example`, `.gitignore`, and `SECRETS.md` next to the
|
|
82
|
+
generated `app.py`. Copy `.env.example` to `.env`, fill in the values, and run.
|
|
83
|
+
The same artifact directory is safe to commit to a public repository.
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
python -m dashml_new.cli build dashboard.dashml --target plotly --output app_dir
|
|
87
|
+
cd app_dir
|
|
88
|
+
cp .env.example .env # edit .env, set DASHML_DB_PASSWORD etc.
|
|
89
|
+
python app.py # reads from env (or .env via python-dotenv)
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
See `SECRETS.md` in any generated SQL/BigQuery artifact for the full list of
|
|
93
|
+
environment variables and recommended deployment patterns (Docker, Kubernetes,
|
|
94
|
+
systemd, CI/CD, GCP Workload Identity).
|
|
95
|
+
|
|
96
|
+
## Example
|
|
97
|
+
|
|
98
|
+
```yaml
|
|
99
|
+
version: 0.1
|
|
100
|
+
title: "Sales Dashboard"
|
|
101
|
+
style: "styles/dracula.dmls"
|
|
102
|
+
|
|
103
|
+
data:
|
|
104
|
+
type: csv
|
|
105
|
+
path: "data/sales.csv"
|
|
106
|
+
|
|
107
|
+
charts:
|
|
108
|
+
- id: "sales_by_country"
|
|
109
|
+
type: "bar"
|
|
110
|
+
title: "Sales by Country"
|
|
111
|
+
x: "country"
|
|
112
|
+
y: "sales"
|
|
113
|
+
agg: "sum"
|
|
114
|
+
sort: "y"
|
|
115
|
+
sort_order: "desc"
|
|
116
|
+
limit: 10
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Documentation
|
|
120
|
+
|
|
121
|
+
- **[User Guide](dashml_new/README.md)** - Full specification reference, chart types, CLI, themes
|
|
122
|
+
- **[Architecture](ARCHITECTURE.md)** - System design, compiler pipeline, type system
|
|
123
|
+
|
|
124
|
+
## Key Concepts
|
|
125
|
+
|
|
126
|
+
- **Compiler, not runtime** - DashML generates standalone code; it never loads or touches your data
|
|
127
|
+
- **Credentials never baked** - generated SQL/BigQuery artifacts read database credentials from environment variables at runtime; safe to version-control
|
|
128
|
+
- **12 chart types** - bar, line, scatter, pie, area, histogram, stacked_bar, grouped_bar, bubble, heatmap, box, geo
|
|
129
|
+
- **3 data sources** - CSV, SQL (PostgreSQL/MySQL/SQLite), Google BigQuery
|
|
130
|
+
- **6 backends** - Streamlit, Plotly, Observable Plot, Apache Superset, Vega-Lite, Grafana
|
|
131
|
+
- **6 built-in themes** - Dracula, Nord, Gruvbox, Monokai, One Dark, Solarized Light
|
|
132
|
+
|
|
133
|
+
## Authors
|
|
134
|
+
|
|
135
|
+
- Dawid Olejniczak
|
|
136
|
+
- Szymon Nowaczyk
|
|
137
|
+
|
|
138
|
+
## License
|
|
139
|
+
|
|
140
|
+
MIT
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
dashml_lang.egg-info/PKG-INFO
|
|
5
|
+
dashml_lang.egg-info/SOURCES.txt
|
|
6
|
+
dashml_lang.egg-info/dependency_links.txt
|
|
7
|
+
dashml_lang.egg-info/entry_points.txt
|
|
8
|
+
dashml_lang.egg-info/requires.txt
|
|
9
|
+
dashml_lang.egg-info/top_level.txt
|
|
10
|
+
dashml_new/__init__.py
|
|
11
|
+
dashml_new/app.py
|
|
12
|
+
dashml_new/cli.py
|
|
13
|
+
dashml_new/generate_startup_data.py
|
|
14
|
+
dashml_new/get_chart.py
|
|
15
|
+
dashml_new/inspect_dashboard.py
|
|
16
|
+
dashml_new/core/__init__.py
|
|
17
|
+
dashml_new/core/engine.py
|
|
18
|
+
dashml_new/core/normalizer.py
|
|
19
|
+
dashml_new/core/parser.py
|
|
20
|
+
dashml_new/core/types.py
|
|
21
|
+
dashml_new/core/validator.py
|
|
22
|
+
dashml_new/core/watcher.py
|
|
23
|
+
dashml_new/transformers/__init__.py
|
|
24
|
+
dashml_new/transformers/base.py
|
|
25
|
+
dashml_new/transformers/constants.py
|
|
26
|
+
dashml_new/transformers/grafana.py
|
|
27
|
+
dashml_new/transformers/observable.py
|
|
28
|
+
dashml_new/transformers/plotly.py
|
|
29
|
+
dashml_new/transformers/registry.py
|
|
30
|
+
dashml_new/transformers/secrets.py
|
|
31
|
+
dashml_new/transformers/streamlit.py
|
|
32
|
+
dashml_new/transformers/superset.py
|
|
33
|
+
dashml_new/transformers/vegalite.py
|
|
34
|
+
tests/test_normalizer.py
|
|
35
|
+
tests/test_validator.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
pyyaml>=6.0
|
|
2
|
+
|
|
3
|
+
[bigquery]
|
|
4
|
+
flask>=3.0.0
|
|
5
|
+
google-cloud-bigquery>=3.0.0
|
|
6
|
+
|
|
7
|
+
[dev]
|
|
8
|
+
pytest>=7.0.0
|
|
9
|
+
build>=1.0.0
|
|
10
|
+
|
|
11
|
+
[sql]
|
|
12
|
+
flask>=3.0.0
|
|
13
|
+
sqlalchemy>=2.0.0
|
|
14
|
+
psycopg2-binary>=2.9.0
|
|
15
|
+
|
|
16
|
+
[streamlit]
|
|
17
|
+
streamlit>=1.40.0
|
|
18
|
+
pandas>=2.0.0
|
|
19
|
+
altair>=5.0.0
|
|
20
|
+
watchdog>=4.0.0
|
|
21
|
+
|
|
22
|
+
[superset]
|
|
23
|
+
requests>=2.32.0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
dashml_new
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"""
|
|
2
|
+
DashML - Declarative Dashboard Language
|
|
3
|
+
|
|
4
|
+
A domain-specific language for building data visualization dashboards.
|
|
5
|
+
Write once in DashML, generate code for multiple platforms.
|
|
6
|
+
"""
|
|
7
|
+
from .core import DashMLEngine, ValidationError
|
|
8
|
+
from .transformers import Transformer, TransformerRegistry
|
|
9
|
+
|
|
10
|
+
__version__ = "0.000000001"
|
|
11
|
+
__all__ = ["DashMLEngine", "ValidationError", "Transformer", "TransformerRegistry"]
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import streamlit as st
|
|
2
|
+
import pandas as pd
|
|
3
|
+
|
|
4
|
+
def main():
|
|
5
|
+
st.set_page_config(
|
|
6
|
+
page_title="DashML Example Dashboard",
|
|
7
|
+
page_icon="📊",
|
|
8
|
+
layout="wide"
|
|
9
|
+
)
|
|
10
|
+
st.title("DashML Example Dashboard")
|
|
11
|
+
|
|
12
|
+
# Load data
|
|
13
|
+
try:
|
|
14
|
+
df = pd.read_csv("data/example.csv")
|
|
15
|
+
except FileNotFoundError:
|
|
16
|
+
st.error("Data file not found: data/example.csv")
|
|
17
|
+
return
|
|
18
|
+
except Exception as e:
|
|
19
|
+
st.error(f"Error loading data: {e}")
|
|
20
|
+
return
|
|
21
|
+
|
|
22
|
+
# Chart: sales_by_country
|
|
23
|
+
st.subheader("Sales by country")
|
|
24
|
+
# Aggregate: sum(sales) group by country
|
|
25
|
+
chart_data = df.groupby("country")["sales"].sum().reset_index()
|
|
26
|
+
chart_data = chart_data.set_index("country")["sales"]
|
|
27
|
+
st.bar_chart(chart_data)
|
|
28
|
+
st.divider()
|
|
29
|
+
|
|
30
|
+
# Chart: sales_over_time
|
|
31
|
+
st.subheader("Sales over time")
|
|
32
|
+
# Aggregate: sum(sales) group by date
|
|
33
|
+
chart_data = df.groupby("date")["sales"].sum().reset_index()
|
|
34
|
+
chart_data = chart_data.set_index("date")["sales"]
|
|
35
|
+
st.line_chart(chart_data)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
if __name__ == "__main__":
|
|
39
|
+
main()
|