Package: beautifultable
IntroductionThis 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 tableBuild the Table as you wish, By adding rows, or by columns or even
mixing both these approaches.Full support forcolorsusing ANSI sequences or any library of your
choice. It just works.Plenty of predefinedstylesfor multiple use cases and option to
create custom ones.Support forUnicodecharacters.Supports streaming table when data is slow to retrieve.LinksDocumentationSourceAPI ReferenceUsageHere 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 thisTutorialInstallationpython3 -m pip install beautifultableChangelogDevelopmentv1.1.0Drop support for Python 3.4, 3.5 and 3.6Add official support for python 3.9 and 3.10Addedasdictandaslistmethod on the row object. (Thanks to@Agent-Hellboy)Addedfrom_csvandto_csvmethods to export/import a csv file. (Thanks to@Agent-Hellboy)Addedfrom_dfandto_dfmethods to export/import a dataframe. (Thanks to@Agent-Hellboy)v1.0.1Fixed an issue where appending a column with a header to an empty table left the table instance in
an inconsistent state.v1.0.0Added two new viewsrowsandcolumnsto theBeautifulTableclass. Most of the existing
methods have been deprecated. Methods of the form{}_rowand{}_columnhave been moved to
viewsrows.{}andcolumns.{}``(ex.``append_rowis nowrows.append). Calling older
deprecated methods will now raise aFutureWarning. Special methods such as__len__,__iter__,
etc. have also been moved to the respective views. For details, refer the
API documentation and the Updated TutorialThe existing styling attributes have also been deprecated. A newborderproperty 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 columnsAdded two new methodsto_csvandfrom_csvto directly export/import to a
csv file. (Thanks to@dinko-pehar)AddedBeautifulTable.rows.filtermethod to generate a new table with only certain rowsAdded a newshapeattribute to theBeautifulTableclass which returns a tuple of form (nrow, ncol)Added new attributeBeautifulTable.columns.header.alignmentwhich can be used to have
a seperate header alignment. The default behaviour is to inheritBeautifulTable.columns.alignmentUpdatedBeautifulTable.rows.sort(earlierBeautifulTable.sort) method to now
also accept any callables as a key.Updated behaviour ofBeautifulTable.columns.width(earlierBeautifulTable.column_widths).
It no longer overrides user specified widths by default. You can reset it to default
by setting it to“auto”Deprecated attributeserialnoandserialno_header. User can now easily implement
this functionality by using row headers if requiredDeprecated methodsget_table_width(),copy()andget_string().Deprecated constructor arguments and class attributes namedsign_mode,numeric_precision,max_widthand renamed tosign,precisionandmaxwidthrespectivelyFixed an issue where table was malformed ifblessingsmodule 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)Fixed several memory leak issues by ensuring that all internal objects hold only a weak reference
to the table instance.Dropped support for Python 2v0.8.0Dropped support for Python 3.3Added support for streaming tables using a generator for cases  where data retrieval is slowAlignment, padding, width can now be set for all columns using a simplified syntax liketable.column_alignments = beautifultable.ALIGN_LEFTv0.7.0Added 4 new styles,STYLE_BOX,STYLE_BOX_DOUBLED,STYLE_BOX_ROUNDED,STYLE_GRID.RenamedSTYLE_RESTRUCTURED_TEXTtoSTYLE_RSTwcwidthis now an optional dependencyUpdated the algorithm for calculating width of columns(better division of space among columns)Added support for Paragraphs(using\ncharacter)Added finer control for intersection characters using 12 new
attributesintersect_{top|header|row|bottom}_{left|mid|right}Added the ability to also accept bytestrings instead of unicodeDeprecated attributeintersection_charDeprecated methodsget_top_border(),get_bottom_border(),get_header_separator(),get_row_separator(),auto_calculate_width()Fixed an issue withWEP_ELLIPSISandWEP_STRIPwhen using multibyte charactersFixed an issue where table would not be in proper form ifcolumn_widthis too lowv0.6.0Added support for handling Multi byte stringsAdded support for colored strings using ANSI escape sequencesAdded constraint where all strings must be unicodeFixed an issue where sometimes width was calculated as higher than intendedv0.5.3Added support for handing color codes using ANSI escape sequences(experimental)Fixed collections ABCs deprecation warningv0.5.2Added new styleSTYLE_NONEFixed issue regarding improper conversion of non-string floatsv0.5.1Addeddetect_numericsboolean for toggling automatic numeric conversionv0.5.0Added new propertyserialno_headerDeprecated methods with misspelled“seperator”in their name.Fixed an issue where table was corrupted whencolumn_countwas too highv0.4.0Added predefined styles for easier customizationAddedreverseargument tosort()methodFixedenum34dependency for python versions prior to 3.4v0.3.0Added propertyserialnofor auto printing serial numberFixed an issue withsign_moderelated to str conversionFixed bugs related to python version prior to 3.3Fixed exception onWEP_ELLIPSISand token length less than 3Fixed printing issues with empty tablev0.2.0Added python 2 supportv0.1.3Fixed minor issuesv0.1.2Added new propertydefault_paddingAdded new methodupdate_rowFixed an issue inauto_calculate_width()v0.1.1Initial release on PyPIContributeIf you have any suggestions or bug reports, Please create a Issue. Pull
Requests are always welcome.LicenseThis project is licensed under the MIT License - see theLICENSE.txtfile for details.DonationLovebeautifultable? Consider supporting the development :)