pytoimage
Note: pytoimage is still in its initial stages, for now, you can normally transform your code in an image, choosing the backgroud and the text color. But, all code is currently with a single color, not differentiating anything, such as keywords, strings, functions... this will come in future versions.
Download
You can simply:
pip install pytoimage
Or you can also:
- Clone the repository to your local machine.
- Enter the directory.
- Download necessary modules/libraries.
git clone https://github.com/gabrielstork/pytoimage.git
cd pytoimage
pip install -r requirements.txt
Example
from pytoimage import PyImage
The PyImage class has three parameters: path (the Python code path), background (optional, the background color of the image) and font (optional, the path of a .ttf font).
code = PyImage('pytoimage/pytoimage.py', background=(15, 15, 15), font='fonts/Inconsolata.ttf')
The following method is optional, it allows you customize the theme of your image (see initial note).
palette = {
'line': (149, 149, 149),
'normal': (255, 255, 255),
}
code.set_color_palette(palette=palette)
To generate the image, you can simply call the method with no arguments, the start and end are optionals, these are the code intervals.
code.generate_image(start=39, end=51)
Then you can see and save the generated image.
code.show_image()
code.save_image('images/example.png')
Metadata
Release files for pytoimage 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pytoimage-0.0.1.tar.gz | 56.9 kB | Without provenance | Details for pytoimage-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pytoimage-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for pytoimage-0.0.1-py3-none-any.whl |
Total release size: 112.1 kB
Release files / pytoimage-0.0.1.tar.gz
| Download URL | pytoimage-0.0.1.tar.gz |
|---|---|
| Size | 56.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1f5798d43988f99e35ee7765bc7a15902bfc63ad7da4750766b3150a1ae46c4d
|
|
BLAKE2b-256 checksum How to use checksums |
4706bbed2f6751e7f60582d8b100842520b57aaf946cfa8cae3eb908887fb0a6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6
|
Release files / pytoimage-0.0.1-py3-none-any.whl
| Download URL | pytoimage-0.0.1-py3-none-any.whl |
|---|---|
| Size | 55.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7fdee6a385fa57e0d3f993687e54f84dcb4d84c58d24556cc70ac8b227f515cd
|
|
BLAKE2b-256 checksum How to use checksums |
66aaf542263ae3d88f64a285251e9a5c7012f3623c7ed67e0ac20f6a069594bb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6
|
Security for pytoimage 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.