{"id":23092979,"url":"https://github.com/crispengari/tabulato","last_synced_at":"2025-07-01T11:36:47.840Z","repository":{"id":221709324,"uuid":"755166249","full_name":"CrispenGari/tabulato","owner":"CrispenGari","description":"🥶🥶👩‍💻This is a Python package that provides functionality for generating tabulated representations of data with customizable colors and formatting options. It offers a user-friendly interface for creating visually appealing tables in terminal output.","archived":false,"fork":false,"pushed_at":"2024-04-09T15:04:22.000Z","size":425,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-27T17:02:43.442Z","etag":null,"topics":["csv","pretty-print","pretty-table","python","tables"],"latest_commit_sha":null,"homepage":"https://tabulato.readthedocs.io/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CrispenGari.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-02-09T15:05:08.000Z","updated_at":"2024-04-09T15:01:47.000Z","dependencies_parsed_at":"2024-02-09T16:42:51.799Z","dependency_job_id":null,"html_url":"https://github.com/CrispenGari/tabulato","commit_stats":null,"previous_names":["crispengari/tabulato"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrispenGari%2Ftabulato","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrispenGari%2Ftabulato/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrispenGari%2Ftabulato/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrispenGari%2Ftabulato/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CrispenGari","download_url":"https://codeload.github.com/CrispenGari/tabulato/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247061214,"owners_count":20877166,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csv","pretty-print","pretty-table","python","tables"],"created_at":"2024-12-16T21:46:08.610Z","updated_at":"2025-04-03T18:44:42.049Z","avatar_url":"https://github.com/CrispenGari.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"### tabulato\n\n`tabulato` is a Python package that provides functionality for generating tabulated representations of data with customizable colors and formatting options. It offers a user-friendly interface for creating visually appealing tables in terminal output.\n\nWith `tabulato`, you can easily format your data into tables with specified headers, apply different colors to headers and rows, and customize the appearance of your tabulated data. Whether you're working on command-line applications, data analysis scripts, or any other project that requires presenting data in a tabular format, `tabulato` can help streamline the process and enhance the visual presentation of your data.\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://pypi.python.org/pypi/tabulato\"\u003e\u003cimg src=\"https://badge.fury.io/py/tabulato.svg\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/crispengari/tabulato/actions/workflows/ci.yml\"\u003e\u003cimg src=\"https://github.com/crispengari/tabulato/actions/workflows/ci.yml/badge.svg\"\u003e\u003c/a\u003e\n  \u003ca href=\"/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-green\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://pypi.python.org/pypi/tabulato\"\u003e\u003cimg src=\"https://img.shields.io/pypi/pyversions/tabulato.svg\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n### Table of Contents\n\n- [tabulato](#tabulato)\n- [Table of Contents](#table-of-contents)\n- [Key features of tabulato include:](#key-features-of-tabulato-include)\n- [Installation](#installation)\n- [Python Version](#python-version)\n- [Example](#example)\n- [What's missing on this package?](#whats-missing-on-this-package)\n- [Docs](#docs)\n- [License](#license)\n\n### Key features of tabulato include:\n\n- Generating tables with customizable colors for headers, even rows, and odd rows.\n- Specifying required columns to ensure important data is always displayed.\n- Option to make headers bold for emphasis.\n- User-friendly API for straightforward integration into your Python projects.\n\n\u003e `tabulato` simplifies the task of formatting and presenting tabular data in terminal environments, making it an essential tool for developers and data scientists working with command-line interfaces.\n\n### Installation\n\nTo install tabulato, you can use pip:\n\n```bash\npip install tabulato\n```\n\n### Python Version\n\nThis package support python version `\u003e=3.10`\n\n### Example\n\nIn the following examples shows you how you can use\n\n```py\nfrom tabulato import colorful_tabulate, TableRowStyle\n\nheaders = [\"Name\", \"Student Number\", \"DOB\", \"Email Address\"]\n\ndata = [\n    [\"John Doe\", \"S12345\", \"1995-07-15\", \"john@example.com\"],\n    [\"Alice Smith\", \"S67890\", \"1998-03-22\", \"alice@example.com\"],\n    [\"Bob Johnson\", \"S54321\", \"1997-11-10\", \"bob@example.com\"],\n    [\"Emma Brown\", \"S98765\", \"1996-09-18\", \"emma@example.com\"],\n    [\"Michael Lee\", \"S24680\", \"1999-05-30\", \"michael@example.com\"],\n    [\"Sophia Wang\", \"S13579\", \"1994-12-05\", \"sophia@example.com\"],\n    [\"David Chen\", \"S75310\", \"1992-04-08\", \"david@example.com\"],\n    [\"Olivia Kim\", \"S36924\", \"1993-10-25\", \"olivia@example.com\"],\n]\n\ncolorful_tabulate(\n    data=data,\n    column_widths=[20, 20, 20, 30],\n)\n```\n\nThe above function will result in the following table being created in the terminal.\n\n```shell\n+----------------------+----------------------+----------------------+--------------------------------+\n| name                 | student number       | dob                  | email                          |\n+----------------------+----------------------+----------------------+--------------------------------+\n| John Doe             | S12345               | 1995-07-15           | john@example.com               |\n| Alice Smith          | S67890               | 1998-03-22           | alice@example.com              |\n| Bob Johnson          | S54321               | 1997-11-10           | bob@example.com                |\n| Emma Brown           | S98765               | 1996-09-18           | emma@example.com               |\n| Michael Lee          | S24680               | 1999-05-30           | michael@example.com            |\n| Sophia Wang          | S13579               | 1994-12-05           | sophia@example.com             |\n| David Chen           | S75310               | 1992-04-08           | david@example.com              |\n| Olivia Kim           | S36924               | 1993-10-25           | olivia@example.com             |\n+----------------------+----------------------+----------------------+--------------------------------+\n```\n\nThe colorful table will look as follows:\n\n\u003cp align='center'\u003e\u003cimg src='https://github.com/CrispenGari/tabulato/blob/main/images/0.jpg?raw=true' alt='demo' width=\"400\"/\u003e\u003c/p\u003e\n\nHowever you can style the rows of the table using the `TableRowStyle` class by specifying the options as follows:\n\n```py\ncolorful_tabulate(\n    data=data,\n    column_widths=[20, 20, 20, 30],\n    header_style=TableRowStyle(\n        bold=True,\n        italic=False,\n        color=\"BLUE\",\n        background=\"BG_BLUE\",\n    ),\n    even_row_style=TableRowStyle(\n        bold=False,\n        italic=False,\n        color=\"GREEN\",\n        underline=True,\n    ),\n    odd_row_style=TableRowStyle(\n        bold=False,\n        italic=False,\n        color=\"YELLOW\",\n        strikethrough=True,\n    ),\n)\n```\n\n\u003cp align='center'\u003e\u003cimg src='https://github.com/CrispenGari/tabulato/blob/main/images/1.jpg?raw=true' alt='demo' width=\"400\"/\u003e\u003c/p\u003e\n\nThe table data can also be a list of python dictionaries. Here is an example of using a list of python dictionaries to generate a table.\n\n```py\n\ndata = [\n    {\n        \"name\": \"John Doe\",\n        \"student number\": \"S12345\",\n        \"dob\": \"1995-07-15\",\n        \"email\": \"john@example.com\",\n    },\n    {\n        \"name\": \"Alice Smith\",\n        \"student number\": \"S67890\",\n        \"dob\": \"1998-03-22\",\n        \"email\": \"alice@example.com\",\n    },\n    {\n        \"name\": \"Bob Johnson\",\n        \"student number\": \"S54321\",\n        \"dob\": \"1997-11-10\",\n        \"email\": \"bob@example.com\",\n    },\n    {\n        \"name\": \"Emma Brown\",\n        \"student number\": \"S98765\",\n        \"dob\": \"1996-09-18\",\n        \"email\": \"emma@example.com\",\n    },\n    {\n        \"name\": \"Michael Lee\",\n        \"student number\": \"S24680\",\n        \"dob\": \"1999-05-30\",\n        \"email\": \"michael@example.com\",\n    },\n    {\n        \"name\": \"Sophia Wang\",\n        \"student number\": \"S13579\",\n        \"dob\": \"1994-12-05\",\n        \"email\": \"sophia@example.com\",\n    },\n    {\n        \"name\": \"David Chen\",\n        \"student number\": \"S75310\",\n        \"dob\": \"1992-04-08\",\n        \"email\": \"david@example.com\",\n    },\n    {\n        \"name\": \"Olivia Kim\",\n        \"student number\": \"S36924\",\n        \"dob\": \"1993-10-25\",\n        \"email\": \"olivia@example.com\",\n    },\n]\n\ncolorful_tabulate(\n    data=data,\n    column_widths=[20, 20, 20, 30],\n)\n```\n\nThe `colorful_tabulate` is a useful function for visually enhancing tabulated data in terminal output by applying colors and styling. The following are the parameters that this function takes.\n\n| Parameter        | Description                            | Type            | Default                                                                    | Required |\n| ---------------- | -------------------------------------- | --------------- | -------------------------------------------------------------------------- | -------- |\n| `data`           | The list of data to be displayed.      | `list`          | -                                                                          | `Yes`    |\n| `headers`        | The list of column headers.            | `list`          | `None`                                                                     | `No`     |\n| `colorful`       | Whether to display the table in color. | `bool`          | `True`                                                                     | `No`     |\n| `bold_header`    | Whether to display the header in bold. | `bool`          | `True`                                                                     | `No`     |\n| `header_style`   | Style for the header row.              | `TableRowStyle` | `TableRowStyle(bold=True, italic=False, color=\"BLUE\", background=None)`    | `No`     |\n| `even_row_style` | Style for even-numbered rows.          | `TableRowStyle` | `TableRowStyle(bold=False, italic=False, color=\"GREEN\", background=None)`  | `No`     |\n| `odd_row_style`  | Style for odd-numbered rows.           | `TableRowStyle` | `TableRowStyle(bold=False, italic=False, color=\"YELLOW\", background=None)` | `No`     |\n| `column_widths`  | List of column widths.                 | `list`          | `[]`                                                                       | `No`     |\n\nThe following are the color literals that can be passed to the `color` abd `background` respectively.\n\n| Color      | Description |\n| ---------- | ----------- |\n| `\"BLACK\"`  | Black       |\n| `\"RED\"`    | Red         |\n| `\"GREEN\"`  | Green       |\n| `\"YELLOW\"` | Yellow      |\n| `\"BLUE\"`   | Blue        |\n| `\"PURPLE\"` | Purple      |\n| `\"CYAN\"`   | Cyan        |\n| `\"WHITE\"`  | White       |\n\n| Background    | Description       |\n| ------------- | ----------------- |\n| `\"BG_BLACK\"`  | Black background  |\n| `\"BG_RED\"`    | Red background    |\n| `\"BG_GREEN\"`  | Green background  |\n| `\"BG_BLUE\"`   | Blue background   |\n| `\"BG_PURPLE\"` | Purple background |\n| `\"BG_CYAN\"`   | Cyan background   |\n| `\"BG_WHITE\"`  | White background  |\n| `\"BG_YELLOW\"` | Yellow background |\n\n### What's missing on this package?\n\nThis package lacks `wrapping` of text for long lines. This `version` only support small tables. Long column data might not end up displayed well, however with small column data like this package is the best.\n\n### Docs\n\nYou can read the full documentation [here](https://tabulato.readthedocs.io/en/latest/).\n\n### License\n\nThis project is licensed under the MIT License - see the [LICENSE](/LISENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrispengari%2Ftabulato","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrispengari%2Ftabulato","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrispengari%2Ftabulato/lists"}