prettytable
A simple Python library for easily displaying tabular data in a visually appealing ASCII table format
Decision gist · record as of 2026-08-14
Yes. PrettyTable is a mature, actively maintained library with no known vulnerabilities, low installation friction, and permissive licensing. It solves a common problem—making tabular data readable in text environments—with a simple API and broad format support. Install it if you need to display structured data in terminals, logs, or text-based reports.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- Low friction installation with a single lightweight runtime dependency (wcwidth).
- Active maintenance with recent release (53 days old) and 1670 repository stars.
License · maintenance · safety
BSD-3-Clause (permissive) — BSD-3-Clause permissive license allows use in commercial and proprietary projects with minimal restrictions.
last release 2026-06-22 (53 days) · last repo commit 2026-08-01 · 1,670 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 56,600,675 downloads/mo, #526 on PyPI
Alternatives
Verify before relying
from prettytable import PrettyTable
table = PrettyTable()
table.field_names = ["City", "Population"]
table.add_row(["Adelaide", 1158259])
print(table)What it is and what it does
PrettyTable is a Python library that converts structured data into formatted ASCII tables suitable for terminal output or text-based display. It accepts data row-by-row, column-by-column, or from external sources like CSV files and database cursors, then renders them as aligned, bordered tables with configurable styling.
The library's primary use case is making tabular output readable in command-line applications, logs, and text reports. It supports pagination for large datasets, field selection to show only relevant columns, and multiple output formats (text, HTML, JSON, CSV, LaTeX, MediaWiki) via the `get_formatted_string()` method. The single runtime dependency is wcwidth, used for proper character width calculation in terminal rendering.
Use it for
- Display query results from a database cursor as a formatted ASCII table in a CLI application.
- Convert CSV file data into a readable table for terminal output or logging.
- Generate paginated table output for large datasets split across multiple pages.
- Export tabular data to HTML, JSON, or LaTeX formats from a single table object.
- Build formatted reports with selective column display for specific audiences.
- Render structured data in scripts and monitoring tools for human-readable output.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
PrettyTable is a mature, actively maintained library with no known vulnerabilities, low installation friction, and permissive licensing. It solves a common problem—making tabular data readable in text environments—with a simple API and broad format support. Install it if you need to display structured data in terminals, logs, or text-based reports.
Install
prettytable on PyPI
Before you install
Low friction installation with a single lightweight runtime dependency (wcwidth). Active maintenance with recent release (53 days old) and 1670 repository stars.
Requires Python 3.10 or later.
License in practice
BSD-3-Clause permissive license allows use in commercial and proprietary projects with minimal restrictions.
Quickstart
from prettytable import PrettyTable
table = PrettyTable()
table.field_names = ["City", "Population"]
table.add_row(["Adelaide", 1158259])
print(table)
Package facts
| License | BSD-3-Clause permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagewcwidth |
| Maintenance | Actively maintained 53 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 56,600,675 / month, #526 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Programming Language :: PythonProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.15Programming Language :: Python :: 3.16Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Text ProcessingTyping :: Typed |
Evidence: prettytable-3.18.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “csv to table output”
- prettytablePrettyTable formats and displays tabular data as visually structured…
- PTablePTable formats tabular data into visually appealing ASCII tables,…
- pytablewriterConverts tabular data into formatted tables for output in multiple…
Give your agent the search over MCP, or paste the wish link into any chat.
More Text Processing packages
A drop-in replacement for Python's standard `re` module that adds advanced regex features like nested sets, fuzzy matching, lookaround in conditionals, and full Unicode case-folding while maintaining backward compatibility.
pyparsing provides a library for building text parsers directly in Python code using composable grammar classes, handling quoted strings, whitespace variation, and embedded comments without regex or lex/yacc.
Install it if you need to parse text or define grammars programmatically.
fonttools manipulates font files in multiple formats (TrueType, OpenType, AFM, Type 1, Mac-specific) and includes TTX, a tool to convert fonts to and from XML text format.
Install it if you need to read, write, or manipulate fonts programmatically or via the TTX command-line tool.
Docutils converts plaintext documentation in reStructuredText format into multiple output formats including HTML, XML, and LaTeX using a modular processing system.
RapidFuzz provides fast fuzzy string matching using Levenshtein Distance and related metrics, implemented mostly in C++ with Python bindings for rapid similarity scoring and approximate string matching.
Install it if you need fuzzy string matching; it's a solid replacement for FuzzyWuzzy with better licensing and performance.
tinycss2 parses CSS strings into token and block objects, and generates CSS strings from those objects, following the CSS Syntax Level 3 specification without enforcing specific properties or values.
Install it if your project requires CSS tokenization or syntax manipulation.
See also PTable · texttable · beautifultable · pytablewriter · sttable · rich · dataflows-tabulator · tabulator · py-markdown-table · terminaltables