{"id":19377915,"url":"https://github.com/hamolicious/console-table","last_synced_at":"2025-07-11T16:17:20.129Z","repository":{"id":57549218,"uuid":"527063773","full_name":"hamolicious/Console-Table","owner":"hamolicious","description":"Displaying Tables in the console","archived":false,"fork":false,"pushed_at":"2022-08-23T13:38:54.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-05T09:16:49.989Z","etag":null,"topics":["console","data","pypi","python","table"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/hamolicious-cli-table/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"wtfpl","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hamolicious.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-20T23:41:02.000Z","updated_at":"2022-08-21T14:01:41.000Z","dependencies_parsed_at":"2022-08-27T00:40:19.963Z","dependency_job_id":null,"html_url":"https://github.com/hamolicious/Console-Table","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hamolicious/Console-Table","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamolicious%2FConsole-Table","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamolicious%2FConsole-Table/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamolicious%2FConsole-Table/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamolicious%2FConsole-Table/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hamolicious","download_url":"https://codeload.github.com/hamolicious/Console-Table/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamolicious%2FConsole-Table/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264851356,"owners_count":23673235,"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":["console","data","pypi","python","table"],"created_at":"2024-11-10T09:04:15.596Z","updated_at":"2025-07-11T16:17:20.111Z","avatar_url":"https://github.com/hamolicious.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Console-Table\nDisplaying Tables in the console\n\n## How To Use\n```python\n# Import package\nfrom cli_table import Table, align_data_left, align_data_center, align_data_right\n\n# Create some data\ndata = [\n\t['First Name', 'Last Name', 'Grade'],\n\t['Roy', 'Trenneman', 5],\n\t['Maurice', 'Moss', 1],\n\t['Jen', 'Barber', 6],\n\t['Douglas', 'Reynholm', 9],\n\t['Richmond', 'Avenal', 7],\n]\n\n# Create the table\ntable = Table(\n\tdata,\n\talignment=[align_data_left, align_data_left, align_data_right],\n\theader_alignment=align_data_center,\n\theader=True,\n)\n\n# Sort by specific rows\ntable.sort_by('Grade')\n\n# Freeze the table\ntable.freeze()\n\n# Print the table\nprint(table)\n```\n\nOutput:\n```\n| First Name | Last Name | Grade |\n| Maurice    | Moss      |     1 |\n| Roy        | Trenneman |     5 |\n| Jen        | Barber    |     6 |\n| Richmond   | Avenal    |     7 |\n| Douglas    | Reynholm  |     9 |\n```\n\n## Arguments\n\n### Table()\nCreates a table object\n\n| Argument            | Type             | Default Value | Description |\n| ------------------- | ---------------- | ------------- |------------ |\n| `data`              | `list[list[Any]]` |  | 2D array containing the data to be used |\n| `margin=`           | `int` | `1` | Margin around cells, (how many spaces before and after data) |\n| `alignment=`        | `Function` \\| `list[Function]` | How to align data, either per column  (type `list`) or globally (type `Function`) |\n| `header_alignment=` | `Function` | How to align headers |\n| `header=`           | `bool` | `False` | Does the data contain a header (0th row is the header) |\n| `add_top=`          | `bool` | `False` | Add a top border around the table |\n| `add_bottom=`       | `bool` | `False` | Add a bottom border around the table |\n| `use_color=`        | `bool` | `False` | Use `colorama` colors for the table |\n| `header_color_bg=`  | `str` | `colorama.Back.RESET` | Header Background Color |\n| `header_color_fg=`  | `str` | `colorama.Fore.LIGHTBLUE_EX` | Header Foreground Color |\n| `odd_color_bg=`     | `str` | `colorama.Back.RESET` | Odd Numbered Cells Background Color |\n| `odd_color_fg=`     | `str` | `colorama.Fore.BLUE` | Odd Numbered Cells Foreground Color |\n| `even_color_bg=`    | `str` | `colorama.Back.RESET` | Even Numbered Cells Background Color |\n| `even_color_fg=`    | `str` | `colorama.Fore.CYAN` | Even Numbered Cells Foreground Color |\n\n### Table().is_frozen()\nChecks if the table needs to be frozen before printing\n\n\n### Table().sort_by()\nSorts the table by the values of a column\n\n| Argument            | Type             | Default Value | Description |\n| ------------------- | ---------------- | ------------- |------------ |\n| `column`            | `str` \\| `int` |  | Which column index(int) or name(str) to sort by |\n| `key=`              | `None` \\| `Callable` | `None` | Sorting key, takes the entire row, should return a sortable value, bu default, returns the entire cell |\n| `reverse=`          | `bool` | `False` | Reverses the sorting algorithm, asc or desc |\n\n\n### Table().freeze()\nCompiles the given data into a string for quick displaying\n\n\n### Table().display() | print(Table())\nPrints the table\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhamolicious%2Fconsole-table","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhamolicious%2Fconsole-table","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhamolicious%2Fconsole-table/lists"}