Skip to content

Commit 4730dea

Browse files
authored
Merge branch 'master' into spelling
2 parents dadd5a0 + 99820ae commit 4730dea

6 files changed

Lines changed: 26 additions & 24 deletions

File tree

src/py/CHANGELOG.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Unreleased
1+
v1.0.0
22
- Add warning if using incompatible Plotly version
33

44
v1.0.0rc15

src/py/README.md

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Kaleido
12

23
<div align="center">
34
<a href="https://dash.plotly.com/project-maintenance">
@@ -6,7 +7,12 @@
67
</a>
78
</div>
89

9-
# Pre-Launch Kaleido v1.0.0
10+
## Overview
11+
12+
Kaleido is a cross-platform Python library for generating static images (e.g. png, svg, pdf, etc.)
13+
for Plotly.js, to be used by Plotly.py.
14+
15+
## Pre-Launch Kaleido v1.0.0
1016

1117
Kaleido allows you to convert plotly figures to images.
1218
Kaleido v1 is currently available as a release candidate.
@@ -40,29 +46,32 @@ Note: Kaleido v1 works with Plotly v6.1.0 and later.
4046

4147
## Installation
4248

43-
To install the Kaleido release candidate:
49+
Kaleido can be installed from [PyPI](https://pypi.org/project/kaleido) using `pip`:
4450

4551
```bash
46-
$ pip install kaleido --upgrade --pre
52+
$ pip install kaleido --upgrade
4753
```
4854

49-
To install Chrome, we recommend using Kaleido's CLI command:
55+
As of version 1.0.0, Kaleido requires Chrome to be installed. If you already have Chrome on your system, Kaleido should find it; otherwise, you can install a compatible Chrome version using the `kaleido_get_chrome` command:
5056

5157
```bash
5258
$ kaleido_get_chrome
5359
```
5460

55-
or functions in Python:
61+
or function in Python:
5662

5763
```python
58-
5964
import kaleido
60-
await kaleido.get_chrome()
61-
# or
62-
# kaleido.get_chrome_sync()
65+
kaleido.get_chrome_sync()
6366
```
6467

65-
## Quickstart
68+
## Development guide
69+
70+
Below are examples of how to use Kaleido directly in your Python program.
71+
72+
If you want to export images of Plotly charts, it's not necessary to call Kaleido directly; you can use functions in the Plotly library. [See the Plotly documentation for instructions.](https://plotly.com/python/static-image-export/)
73+
74+
### Usage examples
6675

6776
```python
6877
import kaleido
@@ -89,7 +98,7 @@ async with kaleido.Kaleido(n=4, timeout=90) as k:
8998
# where `fig_objects` is a dict to be expanded to the fig, path, opts arguments.
9099
```
91100

92-
There are shortcut functions if just want dont want to create a `Kaleido()`.
101+
There are shortcut functions which can be used to generate images without creating a `Kaleido()` object:
93102

94103
```python
95104
import asyncio
@@ -103,7 +112,7 @@ asyncio.run(
103112
)
104113
```
105114

106-
## PageGenerators
115+
### PageGenerators
107116

108117
The `page` argument takes a `kaleido.PageGenerator()` to customize versions.
109118
Normally, kaleido looks for an installed plotly as uses that version. You can pass
@@ -116,13 +125,3 @@ my_page = kaleido.PageGenerator(
116125
others=["a list of other script links to include"]
117126
)
118127
```
119-
120-
## More info
121-
122-
There are plenty of doc strings in the source code.
123-
124-
[choreographer]: https://pypi.org/project/choreographer/
125-
[plotly]: https://plotly.com/
126-
[plotly-export]: https://plotly.com/python/static-image-export/
127-
[pypi]: https://pypi.org/
128-
[repo]: https://github.com/plotly/Kaleido

src/py/kaleido/_mocker.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ def build_mocks():
264264
profiler = {}
265265
asyncio.run(_main(error_log, profiler))
266266
finally:
267+
# ruff: noqa: PLC0415
267268
from operator import itemgetter
268269

269270
for tab, tab_profile in profiler.items():

src/py/kaleido/_page_generator.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ def __init__(self, *, plotly=None, mathjax=None, others=None, force_cdn=False):
5959
plotly = (DEFAULT_PLOTLY, "utf-8")
6060
elif not plotly:
6161
try:
62+
# ruff: noqa: PLC0415
6263
import plotly as pltly # type: ignore [import-not-found]
6364

6465
plotly_path = (

src/py/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ dev = [
4848
"async-timeout",
4949
"mypy>=1.14.1",
5050
"poethepoet>=0.30.0",
51-
"plotly[express]>=6.0.0",
51+
"plotly[express]>=6.1.1",
5252
"pytest-order>=1.3.0",
5353
"pandas>=2.0.3",
5454
]

src/py/tests/test_calc_fig.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313

1414
async def test_calc_fig():
15+
# ruff: noqa: PLC0415
1516
import plotly.express as px
1617

1718
with warnings.catch_warnings():

0 commit comments

Comments
 (0)