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)
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

plot | plot | plot

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.4.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

pillowdrawtable-0.1.4-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pillowdrawtable-0.1.4.tar.gz
  • Upload date:
  • Size: 4.8 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.4.tar.gz
Algorithm Hash digest
SHA256 14545e96285013ee677a1d687e2c96bd24835a918670f192fa4f3efa5706a0df
MD5 3339c3ebbfc36dc928f0d5474b321e9a
BLAKE2b-256 0b14a72817fb8124e8dc3676ab72c2461abae2c2d3ef4393fa6a0782aa4a1585

See more details on using hashes here.

File details

Details for the file pillowdrawtable-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for pillowdrawtable-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 4c1f028a1935dcfa24093f8f94f0afb08bf7a3ae84513deeb5064d9bb0618839
MD5 9d82838de05b1a7e7d228b504b17a723
BLAKE2b-256 b9ec473f99563994040101b0614bc2141015936ea19ce75a84ba29e5cf906c94

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