Skip to content

Commit 2459633

Browse files
committed
fix: add README and LICENSE to package
1 parent 02f06dc commit 2459633

3 files changed

Lines changed: 86 additions & 6 deletions

File tree

src/py/LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) Plotly, Inc
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
13+
all 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
21+
THE SOFTWARE.

src/py/README.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Kaleido
2+
3+
Kaleido is a cross-platform library for generating static images for [Plotly][plotly]'s visualization library.
4+
After installing it, you can use `fig.write_image("filename.png")` to save a plot to a file.
5+
6+
<div align="center">
7+
<a href="https://dash.plotly.com/project-maintenance">
8+
<img src="https://dash.plotly.com/assets/images/maintained-by-plotly.png" width="400px" alt="Maintained by Plotly">
9+
</a>
10+
</div>
11+
12+
## How It Works
13+
14+
The original version of kaleido included a custom build of the Chrome web browser,
15+
which made it very large (hundreds of megabytes) and proved very difficult to maintain.
16+
In contrast,
17+
this version depends on [choreographer][choreographer],
18+
a lightweight library that enables remote control of browsers from Python.
19+
When you ask kaleido to create an image,
20+
it uses choreographer to run a headless instance of Chrome to render and save your figure.
21+
Please see choreographer's documentation for details.
22+
23+
> The new version of kaleido is a work on progress; we would be grateful for help testing it and improving it.
24+
> If you find a bug, please report it in [our GitHub repository][repo],
25+
> and please include a minimal reproducible example if you can.
26+
>
27+
> It would also be very helpful to run the script `src/py/tests/manual.py`
28+
> and attach its zipped output to your bug report.
29+
> This will give us detailed information about the precise versions of software you are using
30+
> and the platform you are running on,
31+
> which will help us track down problems more quickly.
32+
33+
## Installation
34+
35+
You can install kaleido from [PyPI][pypi] using pip:
36+
37+
```
38+
$ pip install kaleido
39+
```
40+
41+
## Use
42+
43+
Versions 4.9 and above of the Plotly Python library will automatically use kaleido for static image export when kaleido is installed.
44+
For example:
45+
46+
```python
47+
import plotly.express as px
48+
fig = px.scatter(px.data.iris(), x="sepal_length", y="sepal_width", color="species")
49+
fig.write_image("figure.png", engine="kaleido")
50+
```
51+
52+
See the [Plotly static image export documentation][plotly-export] for more information.
53+
54+
[choreographer]: https://pypi.org/project/choreographer/
55+
[plotly]: https://plotly.com/
56+
[plotly-export]: https://plotly.com/python/static-image-export/
57+
[pypi]: https://pypi.org/
58+
[repo]: https://github.com/plotly/Kaleido

src/py/pyproject.toml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@ enabled = true
1313

1414
[project]
1515
name = "kaleido"
16-
description = "plotly graph export library"
17-
license = {file = "LICENSE.txt"}
16+
description = "Plotly graph export library"
17+
license = {file = "LICENSE.md"}
1818
readme = "README.md"
1919
requires-python = ">=3.9"
2020
dynamic = ["version"]
21-
dependencies = ["choreographer>=0.99.6",
22-
"async_timeout"
23-
]
21+
dependencies = [
22+
"choreographer>=0.99.6",
23+
"async_timeout"
24+
]
2425
authors = [
2526
{name = "Andrew Pikul", email = "ajpikul@gmail.com"},
2627
]
@@ -31,7 +32,7 @@ maintainers = [
3132
[project.optional-dependencies]
3233
dev = [
3334
"pytest",
34-
]
35+
]
3536

3637
[tool.ruff.lint]
3738
ignore = ["E701"] # E701 oneline if's

0 commit comments

Comments
 (0)