Skip to content

Commit 03d7d97

Browse files
authored
Update README.md
respecting the .pre-commit-config rules
1 parent 99820ae commit 03d7d97

1 file changed

Lines changed: 21 additions & 8 deletions

File tree

src/py/README.md

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
</div>
88

99
# Overview
10-
Kaleido is a cross-platform Python library for generating static images (e.g. png, svg, pdf, etc.) for Plotly.js, to be used by Plotly.py.
10+
Kaleido is a cross-platform Python library for generating static images
11+
(e.g. png, svg, pdf, etc.) for Plotly.js, to be used by Plotly.py.
1112

1213
## Installation
1314

@@ -17,7 +18,9 @@ Kaleido can be installed from [PyPI](https://pypi.org/project/kaleido) using `pi
1718
$ pip install kaleido --upgrade
1819
```
1920

20-
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:
21+
As of version 1.0.0, Kaleido requires Chrome to be installed. If you already have
22+
Chrome on your system, Kaleido should find it; otherwise, you can install
23+
a compatible Chrome version using the `kaleido_get_chrome` command:
2124

2225
```bash
2326
$ kaleido_get_chrome
@@ -32,12 +35,18 @@ kaleido.get_chrome_sync()
3235

3336
## Migrating from v0 to v1
3437

35-
Kaleido v1 introduces a new API. If you're currently using v0, you'll need to make changes to your code and environment where you are running Kaleido.
38+
Kaleido v1 introduces a new API. If you're currently using v0, you'll need
39+
to make changes to your code and environment where you are running Kaleido.
3640

3741
- If using Kaleido v1 with Plotly.py, you will need to install Plotly.py v6.1.1 or later.
38-
- Chrome is no longer included with Kaleido. Kaleido will look for an existing Chrome installation, but also provides commands for installing Chrome. If you don't have Chrome, you'll need to install it. See the installation section above for instructions.
39-
- If your code uses Kaleido directly: `kaleido.scopes.plotly` has been removed in v1. Kaleido v1 provides `write_fig` and `write_fig_sync` for exporting Plotly figures.
40-
```
42+
- Chrome is no longer included with Kaleido. Kaleido will look for an existing Chrome
43+
installation, but also provides commands for installing Chrome.
44+
If you don't have Chrome, you'll need to install it.
45+
See the installation section above for instructions.
46+
- If your code uses Kaleido directly: `kaleido.scopes.plotly` has been removed in v1.
47+
Kaleido v1 provides `write_fig` and `write_fig_sync` for exporting Plotly figures.
48+
49+
```python
4150
from kaleido import write_fig_sync
4251
import plotly.graph_objects as go
4352

@@ -49,7 +58,9 @@ kaleido.write_fig_sync(fig, path="figure.png")
4958

5059
Below are examples of how to use Kaleido directly in your Python program.
5160

52-
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/)
61+
If you want to export images of Plotly charts, it's not necessary to call
62+
Kaleido directly; you can use functions in the Plotly library.
63+
[See the Plotly documentation for instructions.](https://plotly.com/python/static-image-export/)
5364

5465
### Usage examples
5566

@@ -78,7 +89,8 @@ async with kaleido.Kaleido(n=4, timeout=90) as k:
7889
# where `fig_objects` is a dict to be expanded to the fig, path, opts arguments.
7990
```
8091

81-
There are shortcut functions which can be used to generate images without creating a `Kaleido()` object:
92+
There are shortcut functions which can be used to generate images without
93+
creating a `Kaleido()` object:
8294

8395
```python
8496
import asyncio
@@ -98,6 +110,7 @@ The `page` argument takes a `kaleido.PageGenerator()` to customize versions.
98110
Normally, kaleido looks for an installed plotly as uses that version. You can pass
99111
`kaleido.PageGenerator(force_cdn=True)` to force use of a CDN version of plotly (the
100112
default if plotly is not installed).
113+
101114
```
102115
my_page = kaleido.PageGenerator(
103116
plotly="A fully qualified link to plotly (https:// or file://)",

0 commit comments

Comments
 (0)