Registry / serialization / beautifultable

beautifultable

JSON →
library1.1.0pypypi✓ verified 85d ago

beautifultable is a Python library for printing beautiful, structured text tables in terminals, making CLI output more readable. Its current stable version is 1.1.0, released in January 2020. The project appears stable and feature-complete but has not seen active development or new releases since 2020, so its release cadence is infrequent.

pip install beautifultable
INSTALL
IMPORT
SIG · BEAUTIFULTABLE
B
beautifultable
serializationpythonv1.1.0
Install
1.7s avg
Import
79ms
Disk
21MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.1.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.081s · 25MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 1.7s · import 0.078s · 26MB
21MB installed
● package 21MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

BeautifulTable
from beautifultable import BeautifulTable

This quickstart demonstrates how to create a BeautifulTable, set column headers, add rows, and customize column alignment. The output is a formatted string ready for terminal display.

from beautifultable import BeautifulTable table = BeautifulTable() table.columns.header = ["Name", "Age", "City"] table.rows.append(["John", 30, "New York"]) table.rows.append(["Jane", 25, "London"]) table.rows.append(["Doe", 35, "Paris"]) # Example of setting column alignment table.columns.align["Age"] = BeautifulTable.ALIGN_RIGHT print(table)
Debug
Known issues
breakingVersion 1.0.0 introduced a complete rewrite of the API. Many methods and attributes from 0.x versions (e.g., `append_row`, `column_headers`, `set_width`) were removed or replaced with new object-oriented interfaces (e.g., `table.rows.append`, `table.columns.header`, `table.max_width`).
fix
Refer to the 1.x documentation/README for the new API. Common changes include using `table.columns.<attr>` for column-specific settings and `table.rows.<attr>` for row-specific settings.
affects: <1.0.0
gotchaThe project has not been actively maintained since its last release in January 2020. While stable for its intended use, this means there will be no new features, security updates, or bug fixes for any newly discovered issues.
fix
Assess if the current feature set meets your needs. For projects requiring active development, consider alternatives if `beautifultable`'s current state is insufficient.
affects: All versions
gotchaWhen handling mixed data types or special characters, `beautifultable` might require explicit type casting or alignment settings. Incorrect numeric precision or text wrapping can lead to unaligned columns.
fix
Ensure data types are consistent within columns or convert them to strings before adding to the table. Use `table.columns.precision` for numbers and `table.columns.wrap_text` for long strings. Experiment with `table.max_width` and `table.columns.width` to control column layout.
affects: All versions
Errors
Common errors & fixes
AttributeError: 'BeautifulTable' object has no attribute 'append_row'
Attempting to use the `append_row` method from `beautifultable` version 0.x on a 1.x installation.
fix
The `append_row` method was replaced. Use `table.rows.append(data_list)` instead for `beautifultable` versions 1.0.0 and later.
NameError: name 'BeautifulTable' is not defined
The `BeautifulTable` class was not imported into the current scope.
fix
Add `from beautifultable import BeautifulTable` at the top of your Python file or before using the class.
TypeError: The value for 'width' must be a positive number.
Incorrectly trying to set the overall table width using an attribute that no longer exists or expects a specific type/range, or using a method from a previous API version.
fix
For the maximum table width, use `table.max_width = <integer>`. For individual column widths, use `table.columns.width = {column_name: width}` or `table.columns.width[column_name] = width`.
Upgrade
Version history
1.1.0latest on PyPI · released May 6, 2022
Audit
Dependencies

No dependency data recorded yet.

Agent activity
15 hits · last 30 days
node
14
OpenAI (training)
1
Resources
beautifultable — pip install beautifultable · libregistry