Skip to main content

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

pillowdrawtable-0.1.9.tar.gz (5.6 kB view details)

Uploaded Source

File details

Details for the file pillowdrawtable-0.1.9.tar.gz.

File metadata

  • Download URL: pillowdrawtable-0.1.9.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.8

File hashes

Hashes for pillowdrawtable-0.1.9.tar.gz
Algorithm Hash digest
SHA256 0a83b74b3590f3be15ad1d331fabdf39286abdc8b220e69d828d156498e34048
MD5 369df40ea9b2799b0022038efd7aa155
BLAKE2b-256 46a18bdeec56c993cacd4108210be06078e75d9ee1b2ac04c6ad7564027e33ee

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page