@@ -106,10 +106,10 @@ get_style_by_name("catppuccin-frappe")
106106
107107The following style names are available:
108108
109- - ` catppuccin-latte `
110- - ` catppuccin-frappe `
111- - ` catppuccin-macchiato `
112- - ` catppuccin-mocha `
109+ - ` catppuccin-latte `
110+ - ` catppuccin-frappe `
111+ - ` catppuccin-macchiato `
112+ - ` catppuccin-mocha `
113113
114114They can also be accessed by directly importing them:
115115
@@ -137,53 +137,59 @@ The library tries to register styles and colormaps if `matplotlib` is installed.
137137See the examples below for some use cases:
138138
1391391 . Load a style, using ` mpl.style.use `
140- ``` python
141- import catppuccin
142- import matplotlib as mpl
143- import matplotlib.pyplot as plt
144-
145- mpl.style.use(catppuccin.PALETTE .mocha.identifier)
146- plt.plot([0 ,1 ,2 ,3 ], [1 ,2 ,3 ,4 ])
147- plt.show()
148- ```
140+
141+ ``` python
142+ import catppuccin
143+ import matplotlib as mpl
144+ import matplotlib.pyplot as plt
145+
146+ mpl.style.use(catppuccin.PALETTE .mocha.identifier)
147+ plt.plot([0 ,1 ,2 ,3 ], [1 ,2 ,3 ,4 ])
148+ plt.show()
149+ ```
150+
1491511 . Mix it with different stylesheets!
150- ```python
151- import catppuccin
152- import matplotlib as mpl
153- import matplotlib.pyplot as plt
154-
155- mpl.style.use([" ggplot" , catppuccin.PALETTE .mocha.identifier])
156- plt.plot([0 ,1 ,2 ,3 ], [1 ,2 ,3 ,4 ])
157- plt.show()
158- ```
152+
153+ ``` python
154+ import catppuccin
155+ import matplotlib as mpl
156+ import matplotlib.pyplot as plt
157+
158+ mpl.style.use([" ggplot" , catppuccin.PALETTE .mocha.identifier])
159+ plt.plot([0 ,1 ,2 ,3 ], [1 ,2 ,3 ,4 ])
160+ plt.show()
161+ ```
162+
1591631 . Load individual colors
160- ```python
161- import matplotlib.pyplot as plt
162- import catppuccin
163- from catppuccin.extras.matplotlib import load_color
164-
165- color = load_color(catppuccin.PALETTE .latte.identifier, " peach" )
166- plt.plot([0 ,1 ,2 ,3 ], [1 ,2 ,3 ,4 ], color = color)
167- plt.show()
168- ```
164+
165+ ``` python
166+ import matplotlib.pyplot as plt
167+ import catppuccin
168+ from catppuccin.extras.matplotlib import load_color
169+
170+ color = load_color(catppuccin.PALETTE .latte.identifier, " peach" )
171+ plt.plot([0 ,1 ,2 ,3 ], [1 ,2 ,3 ,4 ], color = color)
172+ plt.show()
173+ ```
174+
1691751 . Define custom colormaps
170- ```python
171- import matplotlib.pyplot as plt
172- import numpy as np
173- import catppuccin
174- from catppuccin.extras.matplotlib import get_colormap_from_list
175176
176- cmap = get_colormap_from_list(
177- catppuccin.PALETTE .frappe.identifier,
178- [" red" , " peach" , " yellow" , " green" ],
179- )
180- rng = np.random.default_rng()
181- data = rng.integers(2 , size = (30 , 30 ))
177+ ``` python
178+ import matplotlib.pyplot as plt
179+ import numpy as np
180+ import catppuccin
181+ from catppuccin.extras.matplotlib import get_colormap_from_list
182182
183- plt.imshow(data, cmap = cmap)
184- plt.show()
185- ```
183+ cmap = get_colormap_from_list(
184+ catppuccin.PALETTE .frappe.identifier,
185+ [" red" , " peach" , " yellow" , " green" ],
186+ )
187+ rng = np.random.default_rng()
188+ data = rng.integers(2 , size = (30 , 30 ))
186189
190+ plt.imshow(data, cmap = cmap)
191+ plt.show()
192+ ```
187193
188194## Contribution
189195
@@ -193,14 +199,14 @@ first!
193199
194200### Development
195201
196- This project is maintained with [Poetry ](https:// python - poetry.org ). If you
197- don' t have Poetry yet, you can install it using the [installation
198- instructions](https:// python - poetry.org / docs / # installation).
202+ This project is maintained with [ uv ] ( https://docs.astral.sh/uv/ ) . If you
203+ don't have uv yet, you can install it using the [ installation
204+ instructions] ( https://docs.astral.sh/uv/getting-started/ installation/ ) .
199205
200206Install the project's dependencies including extras:
201207
202208``` bash
203- poetry install -- all - extras
209+ uv sync --all-extras
204210```
205211
206212#### Codegen
@@ -210,27 +216,51 @@ poetry install --all-extras
210216To update after downloading a new palette JSON file:
211217
212218``` console
213- poetry run python build.py
219+ uv run build.py
214220```
215221
216222Formatting this file is done manually as with any other file, see [ ` Code Standards ` ] ( #code-standards ) below.
217223
218224#### Code Standards
219225
220- Before committing changes, it is recommended to run the following tools to
221- ensure consistency in the codebase .
226+ All of the tools listed in this section are automatically installed by uv as
227+ part of the ` dev ` dependency group .
222228
223- ```bash
224- ruff format
225- ruff check
226- mypy .
227- pytest -- cov catppuccin
229+ ##### Unit Tests
230+
231+ Tests are run with [ ` pytest ` ] ( https://docs.pytest.org/en/stable/ ) .
232+
233+ To run tests and display coverage:
234+
235+ ``` console
236+ $ pytest --cov catppuccin
228237```
229238
230- These tools are all installed as part of the `dev` dependency group with
231- Poetry. You can use `poetry shell` to automatically put these tools in your
232- path.
239+ ##### Type Checking
233240
241+ Type checking is performed by [ ` mypy ` ] ( https://www.mypy-lang.org/ ) .
242+
243+ To run type checks:
244+
245+ ``` console
246+ $ mypy .
247+ ```
248+
249+ ##### Lints and Formatting
250+
251+ Code linting and formatting is done by [ ` ruff ` ] ( https://docs.astral.sh/ruff/ ) .
252+
253+ To lint the code:
254+
255+ ``` console
256+ $ ruff check
257+ ```
258+
259+ To format the code:
260+
261+ ``` console
262+ $ ruff format
263+ ```
234264
235265## 💝 Thanks to
236266
0 commit comments