A simple library to visualize lists.
Project description
This is a very simple library to visualize lists in Python.
It was created mainly to support the creation of tutorials for Neps Academy (amazing website :D).
Install
pip install visualist
Usage
The minimal example is shown below. It supposes that we want to create an image from the list [1, 2, -4, 2, -2, 5] and highlight the indexes [2, 4].
from visualist import Visualist
visualist = Visualist()
img = visualist.img_from_list([1, 2, -4, 2, -2, 5], highlight_indexes=[2, 4])
img.show()
The result of this code would be
If you want to save the image change img.show()
to img.save('my_dear_list.png')
.
If you use the method img_from_lists
it will work with a list of lists. Note that the highlights also need to be a list of lists.
from visualist import Visualist
visualist = Visualist()
img = visualist.img_from_lists([[1, 2, -4, 2, -2, 5], [1, 2, 3, 4]], highlight_indexes=[[2, 4], [1]])
img.show()
The result will be
Building the library
To build the library you need the wheel module:
pip install wheel
and run the following command:
python setup.py sdist bdist_wheel
To upload a new version use (don't forget to update the version number in setup.py
):
twine upload dist/*
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for visualist-0.2.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7784ef9509f1f24a8866cca876b3cc1b4c9c3ee97e677d5e478452dc49fca1dc |
|
MD5 | 9f939a24529588125e1ff8613ca00262 |
|
BLAKE2b-256 | e3ba659ad39bb79d22fe72ad279bf37ca7315b1d649793a9abed3718af68b53d |