talira

PrettyTable

Print tables of data as ASCII art in Python

open sourceBSD-3-Clausefree

PrettyTable is a Python library for printing tabular data as neat ASCII tables. Rows can be added one by one or imported from a CSV file or a database cursor, sorted by a field, styled, and printed as text, HTML, JSON, CSV, LaTeX or MediaWiki markup.

Problems it solves

  • print a list of records as a readable table in my Python script
  • show query results as an ASCII table in the terminal
  • turn a CSV file into a formatted text table

Features

  • ASCII tables from rows or columns
  • import from CSV files and database cursors
  • sorting by a field
  • output as text, HTML, JSON, CSV, LaTeX or MediaWiki

Alternatives

The same job

These do what PrettyTable does.

  1. tabulate Pretty-print tabular data in Python as text, Markdown, LaTeX or HTML tables

Compare PrettyTable with the top 3