Python utilities for data presentation

  • 1,382 views
Uploaded on

Adrian Klaver …

Adrian Klaver

An exploration of various Python projects (PyRTF,ReportLab,xlwt) that help with presenting your data in formats (rtf,pdf,xls) that other people want. I will step through a simple data extraction and conversion process using the above software to create an RTF,PDF and XLS file respectively.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
1,382
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
9
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide
  • This is a test

Transcript

  • 1. Python Data Utilities
      • Adrian Klaver
  • 2. Python Data Utilities
    • Psycopg2
      • http://initd.org/pub/software/psycopg/
      • Current version 2.0.12
      • Using 2.0.6
      • Set up DictConnection
      • .pgpass
  • 3. Python Data Utilities
    • Data manipulation
      • Deal with NULL/None
      • Order data by category_desc
        • Do availability determination
        • Pull in correct description and price
      • Create rows
  • 4. Python Data Utilities
    • RTF (Rich Text Format)
      • Program
        • PyRTF
      • Web site
        • http://pyrtf.sourceforge.net/
      • Specifications
        • http://www.biblioscape.com/rtf15_spec.htm
      • Rewrite of code
        • pyrtf-ng
        • http://code.google.com/p/pyrtf-ng/
        • SVN only
  • 5. Python Data Utilities
    • RTF (Rich Text Format)
      • Notes
        • Default language EnglishAustralian
        • Measurements
          • Dimensions in twips 1inch = 1440 twips
          • Fonts are in ½ points
        • Name space
          • Conflict with ReportLab
  • 6. Python Data Utilities
    • RTF (Rich Text Format)
      • Layout
        • Document
          • Section
        • Table
          • Cell
            • Paragraph
              • Text
  • 7. Python Data Utilities
    • XLS
      • Program
        • Xlwt, xlrd, xlutils
      • Web Site
        • http://pypi.python.org/pypi/xlwt
        • http://pypi.python.org/pypi/xlrd
        • http://pypi.python.org/pypi/xlutils
      • OpenOffice Excel docs
        • http://sc.openoffice.org/excelfileformat.pdf
      • Mailing List
        • http://groups.google.com.au/group/python-excel
  • 8. Python Data Utilities
    • XLS
      • Note
        • Column width
          • 1/256 of the width of the zero character using default font (first FONT record in the file).
      • Layout
        • Workbook
          • Worksheet
  • 9. Python Data Utilities
    • PDF
      • Program
        • ReportLab
      • Web site
        • http://www.reportlab.org/rl_toolkit.html
      • Mailing List
        • http://two.pairlist.net/mailman/listinfo/reportlab-users
  • 10. Python Data Utilities
    • PDF
      • NumberedCanvas
        • http://code.activestate.com/recipes/546511/
        • Newer version works w/images http://code.activestate.com/recipes/576832/
      • Notes
        • Dimensions
          • Dimensions in points 1 inch = 72 points.
        • Origin
          • Bottom left
        • Array numbering in tables
          • Column,Row
          • Top left (0,0)
          • Bottom right (-1,-1)
  • 11. Python Data Utilities
    • PDF
      • Paragraph
        • Use para.Paragraph to deal with & <> issues
          • from reportlab.platypus import para