Bashtable is a tables package for Python that provides a simple and easy to use system for creating simplistic and professional looking tables to use in your Python programs.
Bashtable is inspired by Kyostenas' prettyTables and is intended as a simpler way to display data in the Python console.
Run python -m pip install bashtable
in the context of your choice, and Bashtable will be installed into your Python installation's site-packages.
Download the latest release's source code and run python setup.py install
in the root directory.
Input
from bashtable import bashtable
table = bashtable()
table.setData(0, "Bash", "Elliott", "17")
table.setData(1, "Jane", "Doe", "21")
table.setData(2, "John", "Doe", "21")
table.draw()
Output
╔══════╦═════════╦════╗
║ ║ ║ ║
╠══════╬═════════╬════╣
│ Bash │ Elliott │ 17 │
├──────┼─────────┼────┤
│ Jane │ Doe │ 21 │
├──────┼─────────┼────┤
│ John │ Doe │ 21 │
╚──────┴─────────┴────╝
Input
from bashtable import bashtable
table = bashtable()
table.setColumnTitle(0, "First Name")
table.setColumnTitle(1, "Last Name")
table.setColumnTitle(2, "Age")
table.setData(0, "Bash", "Elliott", "17")
table.setData(1, "Jane", "Doe", "21")
table.setData(2, "John", "Doe", "21")
table.draw()
Output
╔════════════╦═══════════╦═════╗
║ First Name ║ Last Name ║ Age ║
╠════════════╬═══════════╬═════╣
│ Bash │ Elliott │ 17 │
├────────────┼───────────┼─────┤
│ Jane │ Doe │ 21 │
├────────────┼───────────┼─────┤
│ John │ Doe │ 21 │
╚────────────┴───────────┴─────╝
If you have any suggestions for Bashtable or want to fork Bashtable to improve upon it or add any features, feel free to do so and even make a pull request! I appreciate each and every contribution made.
If you've found a bug, please make an issue so I can work towards fixing it. I am also reachable by email at spicethings9@gmail.com.
Credit to @Kyostenas and his package prettyTables for the inspiration to create Bashtable.