qmetrics.net

PrettyTable

Python library for ASCII-formatted tables

PrettyTable helps Python programs print tabular data as readable ASCII tables. You can build tables row by row, in bulk, or from CSV and database cursors.

Overview

PrettyTable is a Python package for turning rows and columns of data into fixed-width ASCII tables suited to terminals, logs, and simple reports. You define field names, add rows or columns through several APIs, and render the result to stdout or as a string.

Data can enter the table in flexible ways. Individual rows go in one at a time, whole lists can be added at once, or columns can be filled separately. The library can read comma-separated files and populate a table from a DB-API cursor, which is useful when listing query results in a shell-oriented layout.

Output control covers printing, string export, and alternate layouts. The getstring method produces the same text as print would; getformattedstring can target other formats when supported. Pagination splits large tables across pages with configurable page length and separators.

Presentation options include column alignment for all columns or per field, sorting by a field with optional reverse order, row filtering via callables, restricting visible fields or row ranges, section dividers, titles including multiline titles, and preset or custom visual styles such as Markdown, plain columns, or box-drawing borders.

Key features

  • Row, batch, and column-oriented table building
  • Import from CSV and DB-API cursors
  • ASCII print and string output
  • Multiple output formats via formatting API
  • Pagination for large tables
  • Column alignment and sorting
  • Row filtering and partial display
  • Built-in and customizable table styles

Use cases

  • CLI tools showing query or report results
  • Logging structured rows in development
  • Quick terminal reports from Python scripts
  • Exporting small datasets as readable text
  • Prototyping tabular output before GUI work

Tags

Similar software

World Monitor

Real-time global intelligence dashboard for news and geopolitics

World Monitor combines live news, market data, and geopolitical signals on interactive world maps. Available on the web, as desktop builds, a terminal UI, CLI, SDKs, and an MCP server.

★ 91.3k⟳ todayAGPL-3.0
Open Source Alternative to:Liveuamap

Grafana

Composable observability and data visualization platform

Grafana queries, visualizes, and alerts on metrics, logs, and traces from many backends. Teams build and share dashboards to explore operational data.

★ 78.2k⟳ todayAGPL-3.0
Open Source Alternative to:BetterStackNew Relic

Apache Superset

Web-based data exploration and visualization platform

Apache Superset is a business intelligence application for exploring SQL-backed data, building charts, and sharing dashboards. It connects to many databases through standard SQL drivers and offers both no-code chart building and a SQL editor

★ 75.7k⟳ todayApache-2.0
Open Source Alternative to:ChartioPower BI+2

Metabase

Open-source business intelligence and embedded analytics platform

Metabase lets people across a company explore data and build dashboards without always writing SQL. It connects to databases and warehouses and can be used in the browser or embedded in other applications.

★ 50.6k⟳ todayAGPL-3.0 · open core
Open Source Alternative to:ChartioExplo+3

Streamlit

Agent-native Python framework for data apps

Streamlit turns Python scripts into interactive data apps and dashboards in the browser. Logic, UI, caching, and auth live in one Python layer for people and coding agents.

★ 46.5k⟳ todayApache-2.0

BettaFish

Multi-agent public opinion and research reports

BettaFish is a Python multi-agent system for conversational public-opinion analysis across social platforms. It gathers multimodal signals, debates in a forum engine, and renders interactive HTML reports.

★ 42.8k⟳ 1 month agoGPL-2.0