chartrank 0.1.0__py3-none-any.whl
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.
- chartrank/__init__.py +7 -0
- chartrank/catalog.py +4 -0
- chartrank/cli.py +1 -0
- chartrank/codegen.py +1 -0
- chartrank/dictionary.py +4 -0
- chartrank/gallery.py +1 -0
- chartrank/guards.py +4 -0
- chartrank/profile.py +50 -0
- chartrank/py.typed +0 -0
- chartrank/recommend.py +1 -0
- chartrank/render/__init__.py +1 -0
- chartrank/render/plotly.py +1 -0
- chartrank/spec.py +1 -0
- chartrank/target.py +4 -0
- chartrank-0.1.0.dist-info/METADATA +75 -0
- chartrank-0.1.0.dist-info/RECORD +18 -0
- chartrank-0.1.0.dist-info/WHEEL +4 -0
- chartrank-0.1.0.dist-info/licenses/LICENSE +21 -0
chartrank/__init__.py
ADDED
chartrank/catalog.py
ADDED
chartrank/cli.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Command-line interface: profile, suggest and rank commands."""
|
chartrank/codegen.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Code generation: turn a ChartSpec into a standalone, commented Python script."""
|
chartrank/dictionary.py
ADDED
chartrank/gallery.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Gallery: object returned by suggest(), with show(), best and indexing."""
|
chartrank/guards.py
ADDED
chartrank/profile.py
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"""Column profiling: semantic types and indicators.
|
|
2
|
+
|
|
3
|
+
Version 0.1 is minimal: for each column, its pandas dtype, the share of missing
|
|
4
|
+
values and the number of distinct values. Semantic types come in task 1.1.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import pandas as pd
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def profile(df: pd.DataFrame) -> pd.DataFrame:
|
|
11
|
+
"""Describe each column of ``df``.
|
|
12
|
+
|
|
13
|
+
Args:
|
|
14
|
+
df: The data to describe. It is never modified.
|
|
15
|
+
|
|
16
|
+
Returns:
|
|
17
|
+
One row per column (same order as ``df``), with:
|
|
18
|
+
|
|
19
|
+
- ``dtype``: the pandas dtype, as text (e.g. ``"float64"``);
|
|
20
|
+
- ``missing``: share of missing values, between 0 and 1;
|
|
21
|
+
- ``distinct``: number of distinct non-missing values.
|
|
22
|
+
|
|
23
|
+
Raises:
|
|
24
|
+
TypeError: If ``df`` is not a pandas DataFrame.
|
|
25
|
+
|
|
26
|
+
Example:
|
|
27
|
+
>>> import pandas as pd
|
|
28
|
+
>>> import chartrank as cr
|
|
29
|
+
>>> cr.profile(pd.DataFrame({"Age": [22.0, None, 38.0, 22.0]}))
|
|
30
|
+
dtype missing distinct
|
|
31
|
+
Age float64 0.25 2
|
|
32
|
+
"""
|
|
33
|
+
if not isinstance(df, pd.DataFrame):
|
|
34
|
+
raise TypeError(
|
|
35
|
+
f"profile() expects a pandas DataFrame, got {type(df).__name__}. "
|
|
36
|
+
"Convert your data first, e.g. pd.DataFrame(data) or pd.read_csv(path)."
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
n_rows = len(df)
|
|
40
|
+
rows = {
|
|
41
|
+
column: {
|
|
42
|
+
"dtype": str(df[column].dtype),
|
|
43
|
+
"missing": df[column].isna().sum() / n_rows if n_rows else 0.0,
|
|
44
|
+
"distinct": df[column].nunique(dropna=True),
|
|
45
|
+
}
|
|
46
|
+
for column in df.columns
|
|
47
|
+
}
|
|
48
|
+
return pd.DataFrame.from_dict(
|
|
49
|
+
rows, orient="index", columns=["dtype", "missing", "distinct"]
|
|
50
|
+
)
|
chartrank/py.typed
ADDED
|
File without changes
|
chartrank/recommend.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Recommender: combines catalog and guards, ranks candidates, picks the star chart."""
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Rendering backends that turn a ChartSpec into a figure."""
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Plotly backend: ChartSpec to plotly.graph_objects.Figure, with the common theme."""
|
chartrank/spec.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""ChartSpec: neutral, engine-independent description of a chart."""
|
chartrank/target.py
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: chartrank
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Early preview, not ready for use. Suggests and explains the right chart for your data and intent.
|
|
5
|
+
Project-URL: Homepage, https://github.com/Adeshinan/chartrank
|
|
6
|
+
Project-URL: Issues, https://github.com/Adeshinan/chartrank/issues
|
|
7
|
+
Project-URL: Changelog, https://github.com/Adeshinan/chartrank/blob/main/CHANGELOG.md
|
|
8
|
+
Author: Faïd Adéshinan ALAGBE
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: chart-recommendation,data-visualization,eda,pandas,plotly
|
|
12
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering :: Visualization
|
|
21
|
+
Classifier: Typing :: Typed
|
|
22
|
+
Requires-Python: >=3.11
|
|
23
|
+
Requires-Dist: numpy>=1.26
|
|
24
|
+
Requires-Dist: pandas>=2.2
|
|
25
|
+
Requires-Dist: plotly>=5.24
|
|
26
|
+
Requires-Dist: pyyaml>=6.0
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
Requires-Dist: build>=1.2; extra == 'dev'
|
|
29
|
+
Requires-Dist: mkdocs-material>=9.5; extra == 'dev'
|
|
30
|
+
Requires-Dist: mkdocs-static-i18n>=1.2; extra == 'dev'
|
|
31
|
+
Requires-Dist: mypy>=1.11; extra == 'dev'
|
|
32
|
+
Requires-Dist: pandas-stubs>=2.2; extra == 'dev'
|
|
33
|
+
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
|
|
34
|
+
Requires-Dist: pytest-socket>=0.7; extra == 'dev'
|
|
35
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
36
|
+
Requires-Dist: ruff>=0.6; extra == 'dev'
|
|
37
|
+
Requires-Dist: twine>=6.0; extra == 'dev'
|
|
38
|
+
Requires-Dist: types-pyyaml>=6.0; extra == 'dev'
|
|
39
|
+
Provides-Extra: docs
|
|
40
|
+
Requires-Dist: mkdocs-material>=9.5; extra == 'docs'
|
|
41
|
+
Requires-Dist: mkdocs-static-i18n>=1.2; extra == 'docs'
|
|
42
|
+
Provides-Extra: static
|
|
43
|
+
Requires-Dist: kaleido>=1.0; extra == 'static'
|
|
44
|
+
Description-Content-Type: text/markdown
|
|
45
|
+
|
|
46
|
+
# ChartRank
|
|
47
|
+
|
|
48
|
+
[](https://github.com/Adeshinan/chartrank/actions/workflows/ci.yml)
|
|
49
|
+
[](https://adeshinan.github.io/chartrank/)
|
|
50
|
+

|
|
51
|
+
[](LICENSE)
|
|
52
|
+
|
|
53
|
+
**Suggests and explains the right chart for your data and intent.**
|
|
54
|
+
|
|
55
|
+
> 🚧 Work in progress — v1.0 planned for December 2026.
|
|
56
|
+
|
|
57
|
+
Give ChartRank one or two columns and an intent (`compare`, `distribution`,
|
|
58
|
+
`relationship`, `composition`, `trend`). It proposes 3 to 5 charts drawn on your
|
|
59
|
+
own data, marks the recommended one with ★, explains each with numbers computed
|
|
60
|
+
from your data ("good for / avoid if"), and gives you the image or a standalone
|
|
61
|
+
Python script to reproduce it. Deterministic, local, no AI.
|
|
62
|
+
|
|
63
|
+
```python
|
|
64
|
+
import chartrank as cr
|
|
65
|
+
|
|
66
|
+
g = cr.suggest(df, x="Pclass", y="Fare", intent="compare")
|
|
67
|
+
g.show()
|
|
68
|
+
print(g.best.why)
|
|
69
|
+
print(g.best.code)
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
*This API is the v1.0 target and is not available yet.*
|
|
73
|
+
|
|
74
|
+
[Documentation](https://adeshinan.github.io/chartrank/) ·
|
|
75
|
+
[Version française](README.fr.md) · License: [MIT](LICENSE)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
chartrank/__init__.py,sha256=sks0q6A6YH-K6Y87_23p8IPK-Rm-0PIYS1XvjIwmw84,181
|
|
2
|
+
chartrank/catalog.py,sha256=2Igf-JrKlv8P3zZWZrLzN5YM9ED_PIw4Fkzn1YjiYLU,95
|
|
3
|
+
chartrank/cli.py,sha256=8yToQWeV_apWErYQ2J-WY2kfFntaDU3l_ZwbeQlE6yM,66
|
|
4
|
+
chartrank/codegen.py,sha256=UjJbQqz4N0DX90UxL1g8wwUSVIw3Qyju7sGvB-WWk5c,84
|
|
5
|
+
chartrank/dictionary.py,sha256=ZkjDsv1iPk74I0OGe4cz4DolzYlbV8yM2ttfZC1ojCg,96
|
|
6
|
+
chartrank/gallery.py,sha256=A30utvDd1iv_cbNhcQRRsZsPW2pBcbaK7iZ0ZRAXNYE,77
|
|
7
|
+
chartrank/guards.py,sha256=ggHBBgjmEDx6esuc3b_vQUbvMUHmeSU66REPT2k18Bw,101
|
|
8
|
+
chartrank/profile.py,sha256=MkjCJtL95IoYV8sc4nOfdle-P8Jg8_aq8TNXLSCkWPU,1598
|
|
9
|
+
chartrank/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
|
+
chartrank/recommend.py,sha256=hzhrP1SHqpkzn9f3A8hpO9gciM4_3SoYFtUeizhcS6Q,88
|
|
11
|
+
chartrank/spec.py,sha256=3VQSlaI582PkGxnnvvOAwtdxgkNL73NmMWCEQmHF-Ls,69
|
|
12
|
+
chartrank/target.py,sha256=_zjB2DDYvurxbWzbwHv8B9RnntRvJeMo4eFJv4Jo1ps,97
|
|
13
|
+
chartrank/render/__init__.py,sha256=EvDhWIYdWtl87fugTgVlCFUChryghjvh4i_PRvHbMnI,62
|
|
14
|
+
chartrank/render/plotly.py,sha256=I5AlyE-TR0mXj5H06LzMUf_SDQ_3IrATcU1SuQz2fkc,87
|
|
15
|
+
chartrank-0.1.0.dist-info/METADATA,sha256=9IFovlFd7XmYejnuPrgUKdgD9-8OhDxnfkomUN7oJJg,3202
|
|
16
|
+
chartrank-0.1.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
|
|
17
|
+
chartrank-0.1.0.dist-info/licenses/LICENSE,sha256=0ksk9JlOBL2INVYcn7HrQ0GEaUVT17r45K1ii-IZN9M,1080
|
|
18
|
+
chartrank-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Faïd Adéshinan ALAGBE
|
|
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.
|