Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matthewandretaylor/ipysketch_lite
A lite sketching utility for notebooks no dependencies
https://github.com/matthewandretaylor/ipysketch_lite
notebook python
Last synced: about 23 hours ago
JSON representation
A lite sketching utility for notebooks no dependencies
- Host: GitHub
- URL: https://github.com/matthewandretaylor/ipysketch_lite
- Owner: MatthewAndreTaylor
- Created: 2024-05-04T02:15:24.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-11-06T16:25:16.000Z (12 days ago)
- Last Synced: 2024-11-06T17:30:41.086Z (12 days ago)
- Topics: notebook, python
- Language: Python
- Homepage: https://matthewandretaylor.github.io/ipysketch_lite/
- Size: 469 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ipysketch_lite
A lite sketching utility for python notebooks, no sockets or extra dependencies 🎨
(no extra widget code)
Make sketches right in your notebook then use the sketch in your python code.
Try yourself:
![demo](https://github.com/user-attachments/assets/32504e77-a9d1-43c2-96ff-dc0acff48393)
[![PyPI](https://img.shields.io/pypi/v/ipysketch-lite.svg)](https://pypi.org/project/ipysketch-lite)
[![Docs](https://img.shields.io/badge/Docs-informational?logo=readthedocs&logoColor=white)](https://matthewandretaylor.github.io/ipysketch_lite/docs)## Quickstart
To get started pip install the extension from [PyPI](https://pypi.org/project/ipysketch-lite)
This can be done using `pip` for jupyter environments
```bash
pip install ipysketch-lite
```Or using `piplite` if you are using [jupyter lite](https://matthewandretaylor.github.io/ipysketch_lite/jupyterlite/lab?path=lite_example.ipynb)
```py
import piplite
await piplite.install("ipysketch_lite[extra]") # install the package and optionally pillow and numpy for the extra features
```Start drawing a quick sketch in your notebook like this
```py
from ipysketch_lite import Sketchsketch = Sketch()
```Then add a new cell to retrieve the sketch in python
```py
sketch.data # Sketch image data as a base64 encoded string
``````py
import matplotlib.pyplot as plt# Plot the sketch image or do image manipulation
plt.imshow(sketch.image)
plt.show()
```![example sketch](https://github.com/MatthewAndreTaylor/ipysketch_lite/blob/main/sketches/example.png?raw=true)
Sketches get updated in cells after draw updates
This means you can continue your sketch and get the new updated outputs