All Projects → pri22296 → Beautifultable

pri22296 / Beautifultable

Licence: mit
Python package for printing visually appealing tables on a terminal.

Programming Languages

python
139335 projects - #7 most used programming language
python3
1442 projects

Projects that are alternatives of or similar to Beautifultable

Csview
📠 A high performance csv viewer with cjk/emoji support.
Stars: ✭ 208 (+89.09%)
Mutual labels:  terminal, table
Simpletable
Simple tables in terminal with Go
Stars: ✭ 288 (+161.82%)
Mutual labels:  terminal, table
Asciigraph
Go package to make lightweight ASCII line graph ╭┈╯ in command line apps with no other dependencies.
Stars: ✭ 1,805 (+1540.91%)
Mutual labels:  utility, terminal
Comfy Table
🔶 Build beautiful terminal tables with automatic content wrapping
Stars: ✭ 156 (+41.82%)
Mutual labels:  terminal, table
Tabulate
Table Maker for Modern C++
Stars: ✭ 862 (+683.64%)
Mutual labels:  terminal, table
Synth Shell
Boost your terminal, script by script
Stars: ✭ 217 (+97.27%)
Mutual labels:  utility, terminal
Laravel Zero
A PHP framework for console artisans
Stars: ✭ 2,821 (+2464.55%)
Mutual labels:  utility, terminal
Haxor News
Browse Hacker News like a haxor: A Hacker News command line interface (CLI).
Stars: ✭ 3,342 (+2938.18%)
Mutual labels:  utility, terminal
Terminaltables
Generate simple tables in terminals from a nested list of strings.
Stars: ✭ 685 (+522.73%)
Mutual labels:  terminal, table
Saws
A supercharged AWS command line interface (CLI).
Stars: ✭ 4,886 (+4341.82%)
Mutual labels:  utility, terminal
Git Extra Status
Get more information for a single or batch of git repositories with a single command
Stars: ✭ 102 (-7.27%)
Mutual labels:  utility, terminal
Goat
POSIX-compliant shell movement boosting hack for real ninjas (aka `cd x` and `cd ...`)
Stars: ✭ 27 (-75.45%)
Mutual labels:  utility, terminal
Httpcat
httpcat is a simple utility for constructing raw HTTP requests on the command line.
Stars: ✭ 109 (-0.91%)
Mutual labels:  utility, terminal
Vue Table Dynamic
🎉 A dynamic table with sorting, filtering, editing, pagination, multiple select, etc.
Stars: ✭ 106 (-3.64%)
Mutual labels:  table
Hyper
A terminal built on web technologies
Stars: ✭ 37,504 (+33994.55%)
Mutual labels:  terminal
Nvim Toggleterm.lua
A neovim lua plugin to help easily manage multiple terminal windows
Stars: ✭ 102 (-7.27%)
Mutual labels:  terminal
Unix Permissions
Swiss Army knife for Unix permissions
Stars: ✭ 106 (-3.64%)
Mutual labels:  terminal
Ls colors
A collection of LS_COLORS definitions; needs your contribution!
Stars: ✭ 1,568 (+1325.45%)
Mutual labels:  terminal
Terminals Are Sexy
💥 A curated list of Terminal frameworks, plugins & resources for CLI lovers.
Stars: ✭ 10,235 (+9204.55%)
Mutual labels:  terminal
Simplec
C/C++ develop tool for android.
Stars: ✭ 105 (-4.55%)
Mutual labels:  terminal

########################################################################## beautifultable ##########################################################################

.. inclusion-marker-badges-start

.. image:: https://badge.fury.io/py/beautifultable.svg :target: https://badge.fury.io/py/beautifultable

.. image:: https://img.shields.io/pypi/pyversions/beautifultable.svg :target: https://pypi.python.org/pypi/beautifultable/

.. image:: https://codecov.io/gh/pri22296/beautifultable/branch/master/graphs/badge.svg :target: https://codecov.io/gh/pri22296/beautifultable/branch/master/

.. image:: https://api.codacy.com/project/badge/Grade/7a76eb35ad4e450eaf00339e98381511 :target: https://www.codacy.com/app/pri22296/beautifultable?utm_source=github.com&utm_medium=referral&utm_content=pri22296/beautifultable&utm_campaign=Badge_Grade

.. image:: https://travis-ci.org/pri22296/beautifultable.svg?branch=master :target: https://travis-ci.org/pri22296/beautifultable

.. image:: https://readthedocs.org/projects/beautifultable/badge/?version=latest :alt: Documentation Status :target: http://beautifultable.readthedocs.io/en/latest/?badge=latest

.. image:: https://img.shields.io/badge/Donate-PayPal-yellow.svg :target: https://paypal.me/beautifultable

.. inclusion-marker-badges-end

.. inclusion-marker-introduction-start


Introduction


This Package provides BeautifulTable class for easily printing tabular data in a visually appealing format to a terminal.

Features included but not limited to:

  • Full customization of the look and feel of the table
  • Build the Table as you wish, By adding rows, or by columns or even mixing both these approaches.
  • Full support for colors using ANSI sequences or any library of your choice. It just works.
  • Plenty of predefined styles for multiple use cases and option to create custom ones.
  • Support for Unicode characters.
  • Supports streaming table when data is slow to retrieve.

.. inclusion-marker-introduction-end

.. inclusion-marker-links-start


Links


  • Documentation <http://beautifultable.readthedocs.io/en/latest/>_

  • Source <https://github.com/pri22296/beautifultable>_

  • API Reference <http://beautifultable.readthedocs.io/en/latest/source/beautifultable.html#module-beautifultable>_

.. inclusion-marker-links-end

.. inclusion-marker-usage-start


Usage


Here is an example of how you can use beautifultable::

>>> from beautifultable import BeautifulTable
>>> table = BeautifulTable()
>>> table.rows.append(["Jacob", 1, "boy"])
>>> table.rows.append(["Isabella", 1, "girl"])
>>> table.rows.append(["Ethan", 2, "boy"])
>>> table.rows.append(["Sophia", 2, "girl"])
>>> table.rows.append(["Michael", 3, "boy"])
>>> table.rows.header = ["S1", "S2", "S3", "S4", "S5"]
>>> table.columns.header = ["name", "rank", "gender"]
>>> print(table)
+----+----------+------+--------+
|    |   name   | rank | gender |
+----+----------+------+--------+
| S1 |  Jacob   |  1   |  boy   |
+----+----------+------+--------+
| S2 | Isabella |  1   |  girl  |
+----+----------+------+--------+
| S3 |  Ethan   |  2   |  boy   |
+----+----------+------+--------+
| S4 |  Sophia  |  2   |  girl  |
+----+----------+------+--------+
| S5 | Michael  |  3   |  boy   |
+----+----------+------+--------+

You can learn more about beautifultable at this Tutorial <http://beautifultable.readthedocs.io/en/latest/quickstart.html>_

.. inclusion-marker-usage-end

.. inclusion-marker-install-start


Installation


::

python3 -m pip install beautifultable

.. inclusion-marker-install-end

.. inclusion-marker-changelog-start


Changelog


========== v1.0.1

  • Fixed an issue where appending a column with a header to an empty table left the table instance in an inconsistent state.

========== v1.0.0

  • Added two new views rows and columns to the BeautifulTable class. Most of the existing methods have been deprecated. Methods of the form {}_row and {}_column have been moved to views rows.{} and columns.{}(ex. append_row is now rows.append). Calling older deprecated methods will now raise a FutureWarning. Special methods such as __len__, __iter__, etc. have also been moved to the respective views. For details, refer the API documentation and the Updated Tutorial
  • The existing styling attributes have also been deprecated. A new border property can be accessed to control all styling attributes affecting the border. Rest of the attributes can be accessed from it's respective view.
  • Added support for row headers. As a result rows can now be accessed by their keys similar to columns
  • Added two new methods to_csv and from_csv to directly export/import to a csv file. (Thanks to @dinko-pehar <https://github.com/dinko-pehar>_)
  • Added BeautifulTable.rows.filter method to generate a new table with only certain rows
  • Added a new shape attribute to the BeautifulTable class which returns a tuple of form (nrow, ncol)
  • Added new attribute BeautifulTable.columns.header.alignment which can be used to have a seperate header alignment. The default behaviour is to inherit BeautifulTable.columns.alignment
  • Updated BeautifulTable.rows.sort (earlier BeautifulTable.sort) method to now also accept any callables as a key.
  • Updated behaviour of BeautifulTable.columns.width (earlier BeautifulTable.column_widths). It no longer overrides user specified widths by default. You can reset it to default by setting it to "auto"
  • Deprecated attribute serialno and serialno_header. User can now easily implement this functionality by using row headers if required
  • Deprecated methods get_table_width(), copy() and get_string().
  • Deprecated constructor arguments and class attributes named sign_mode, numeric_precision, max_width and renamed to sign, precision and maxwidth respectively
  • Fixed an issue where table was malformed if blessings module was used to generate colored strings.
  • Fixed issues with the existing implementation of __iter__, __copy__ and __deepcopy__ which should now work more reliably.
  • Fixed an issue where default padding could not be set to 0. (Thanks to @furlongm <https://github.com/furlongm>_)
  • Fixed several memory leak issues by ensuring that all internal objects hold only a weak reference to the table instance.
  • Dropped support for Python 2

========== v0.8.0

  • Dropped support for Python 3.3
  • Added support for streaming tables using a generator for cases where data retrieval is slow
  • Alignment, padding, width can now be set for all columns using a simplified syntax like table.column_alignments = beautifultable.ALIGN_LEFT

========== v0.7.0

  • Added 4 new styles, STYLE_BOX, STYLE_BOX_DOUBLED, STYLE_BOX_ROUNDED, STYLE_GRID.
  • Renamed STYLE_RESTRUCTURED_TEXT to STYLE_RST
  • wcwidth is now an optional dependency
  • Updated the algorithm for calculating width of columns(better division of space among columns)
  • Added support for Paragraphs(using \n character)
  • Added finer control for intersection characters using 12 new attributes intersect_{top|header|row|bottom}_{left|mid|right}
  • Added the ability to also accept bytestrings instead of unicode
  • Deprecated attribute intersection_char
  • Deprecated methods get_top_border(), get_bottom_border(), get_header_separator(), get_row_separator(), auto_calculate_width()
  • Fixed an issue with WEP_ELLIPSIS and WEP_STRIP when using multibyte characters
  • Fixed an issue where table would not be in proper form if column_width is too low

========== v0.6.0

  • Added support for handling Multi byte strings
  • Added support for colored strings using ANSI escape sequences
  • Added constraint where all strings must be unicode
  • Fixed an issue where sometimes width was calculated as higher than intended

========== v0.5.3

  • Added support for handing color codes using ANSI escape sequences(experimental)
  • Fixed collections ABCs deprecation warning

========== v0.5.2

  • Added new style STYLE_NONE
  • Fixed issue regarding improper conversion of non-string floats

========== v0.5.1

  • Added detect_numerics boolean for toggling automatic numeric conversion

========== v0.5.0

  • Added new property serialno_header
  • Deprecated methods with misspelled "seperator" in their name.
  • Fixed an issue where table was corrupted when column_count was too high

========== v0.4.0

  • Added predefined styles for easier customization
  • Added reverse argument to sort() method
  • Fixed enum34 dependency for python versions prior to 3.4

========== v0.3.0

  • Added property serialno for auto printing serial number
  • Fixed an issue with sign_mode related to str conversion
  • Fixed bugs related to python version prior to 3.3
  • Fixed exception on WEP_ELLIPSIS and token length less than 3
  • Fixed printing issues with empty table

========== v0.2.0

  • Added python 2 support

========== v0.1.3

  • Fixed minor issues

========== v0.1.2

  • Added new property default_padding
  • Added new method update_row
  • Fixed an issue in auto_calculate_width()

========== v0.1.1

  • Initial release on PyPI

.. inclusion-marker-changelog-end

.. inclusion-marker-contribution-start


Contribute


If you have any suggestions or bug reports, Please create a Issue. Pull Requests are always welcome.

.. inclusion-marker-contribution-end

.. inclusion-marker-license-start


License


This project is licensed under the MIT License - see the LICENSE.txt <https://github.com/pri22296/beautifultable/blob/master/LICENSE.txt>_ file for details.

.. inclusion-marker-license-end

.. inclusion-marker-donation-start


Donation


Love beautifultable? Consider supporting the development :)

.. image:: https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif :target: https://paypal.me/beautifultable

.. inclusion-marker-donation-end

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].