Draw a table in pillow image
Project description
Drawtable in pillow image
It used to draw a table in your pillow image by taking data, coordinates font etc
Installation
pip install pillowdrawtable
Formats
- data format = [(1,0,1),(10,2,5)]
- font_path is a path of downloaded font from open resource
Code Snippet
import PIL
text_font = PIL.ImageFont.truetype("arial.ttf", 16) #PIL.ImageFont.truetype(FONT_PATH,FONTSIZE)
header_font = PIL.ImageFont.truetype("arial.ttf", 16)
tdata= [("1",'2'),("19",100),("20",10)]
table = Drawtable(data=tdata,
x=60,
xend=400,
y=80,
font=text_font,
line_spacer=10,
margin_text=10,
image_width=500,
image_height=300,
frame=True,
grid=True,
columngrid=False,
rowgrid=False,
header=True,
text_color='green',
header_color='red',
headerfont=header_font,
save="outputtable2.png"
)
table.draw_table()
Output
License
Copyright (c) 2022 Dhanush Nayak
Project details
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
File details
Details for the file pillowdrawtable-0.1.4.1.tar.gz
.
File metadata
- Download URL: pillowdrawtable-0.1.4.1.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5f35aa752e7d85e9ddc3ed3a6b3311a5f002659bc869551d388379e653deaa4 |
|
MD5 | 0bbc5970fccdd73925e7d15c9f96d1e9 |
|
BLAKE2b-256 | dd294b5acf6caa3f83372b27c6380b8af71651691b6a6e0e1873603e529d7616 |
File details
Details for the file pillowdrawtable-0.1.4.1-py3-none-any.whl
.
File metadata
- Download URL: pillowdrawtable-0.1.4.1-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5f09466d0815505bb03aeae76bfa4840551358039471b81adae4ab2b27b7a82 |
|
MD5 | 7dabf0a0ff2a513910a6e6aa8a14bba3 |
|
BLAKE2b-256 | 7e2ee46585435950629bd8682ce12d1765861fa5eb123796debf118154bd418e |