You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

pretty-tabulate

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pretty-tabulate

Lightweight table formatting with color support for terminal output

pipPyPI
Version
2.37.2
Maintainers
1

Pretty Tabulate

A lightweight Python library for formatting data as beautiful, colored tables in the terminal.

Features

  • Simple API for creating formatted tables
  • ANSI color support with automatic terminal detection
  • Configurable column alignment, padding, and borders
  • Works with lists of dicts, lists of lists, or pandas DataFrames

Installation

pip install pretty-tabulate

Quick Start

from pretty_tabulate import PrettyTable, Color

# Create a table from data
data = [
    {"name": "Alice", "score": 95, "grade": "A"},
    {"name": "Bob", "score": 87, "grade": "B+"},
    {"name": "Charlie", "score": 72, "grade": "C"},
]

table = PrettyTable(data)
print(table.render(color=Color.GREEN))

API Reference

PrettyTable(data, headers=None)

Create a table from data (list of dicts or list of lists).

table.render(color=None, border=True, padding=1)

Render the table as a formatted string.

format_table(data, headers=None, color=None)

One-liner convenience function.

colorize(text, color)

Apply ANSI color to text.

License

MIT

Keywords

table

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts