PythonTaCo


NamePythonTaCo JSON
Version 1.3.7 PyPI version JSON
download
home_page
SummaryModule for creating tables for console applications
upload_time2024-03-02 23:04:47
maintainer
docs_urlNone
author
requires_python>=3.10
licenseMIT License Copyright (c) 2024 Mykhailo Holub Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords console table
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # PythonTableConsole
Simple console-oriented handler for python two-dimensional lists (tables). Put your list in handler,  modify it and use it from handler or take it out from handler and use on its own.
#### Features:
 - List handler that works with python 2-dimensional lists.
 - Easy access to height and width of the table.
 - Simple handy functions: transposing and sorting.
 - Print your lists as tables to the console!
## Examples:
#### Creating table from list:
```python
import PythonTableConsole as PTC
my_list = [['a', 'b', 'c'], [1, 2, 3], [7,4,3,2,0,10]]
Table = PTC.PythonTableConsole(my_list)
# or PTC.PythonTableConsole([['a', 'b', 'c'], [1, 2, 3], [7,4,3,2,0,10]])
```
#### Printing table to the console:
```python
print(Table)
'''
result:
|a|1| 7|
|b|2| 4|
|c|3| 3|
| | | 2|
| | | 0|
| | |10|
'''
```
#### Changing table:
```python
Table.contains[0][0] = 'alpha'
```
#### Functions of the PythonTableConsole class:
```python
Table.width()  # returns number of columns
Table.height()  # returns number of rows
Table.transpose()  # transposes the Table: rows to columns, columns to rows
Table.sort_by_column(column_index, skip_n_rows = 0)  # sorts the table (except first n rows) by specified column. MAY BE REMOVED IN THE FUTURE
Table.sort_by_column_with_skips(column_index, skip_rows = [], skip_columns = [], largest_at_the_top = True)  # sorts the table (except specified rows and columns) by the specified column.
Table.sort_by_row_with_skips(row_index, skip_rows = [], skip_columns = [], largest_at_the_top = True)  # sorts the table (except specified rows and columns) by the specified row.
```

## Other, uh... important? notes:
#### Columns not rows
PythonTableConsole handles inner lists as columns.
```python
pos_x, pos_y = 0, 0
Table.contains[pos_x][pos_y]  # not [pos_y][pos_x]
```
Row-centered handler may be implemented in the future. But for now you can transpose your tables to compensate for that handler absense.
#### Updates are completely random
This is a pet-project so...

## Planned features:
#### Row-centered handler
For now only column-centered is present in this module.
#### Width constrains for __str__
 - Default max width for table's columns
 - Max width for table's columns
 - Max widths (in list, idk) dor table's columns
 - "New line or cut" option (maybe with "cut after n new_lines" option)

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "PythonTaCo",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "",
    "keywords": "console,table",
    "author": "",
    "author_email": "Mykhailo Holub <MykhalioHolub@proton.me>",
    "download_url": "https://files.pythonhosted.org/packages/ff/3f/b60b96e19fb5afd93a5e5bba37f55c8544d4ba6211b68a2ed93818b8fc33/PythonTaCo-1.3.7.tar.gz",
    "platform": null,
    "description": "# PythonTableConsole\r\nSimple console-oriented handler for python two-dimensional lists (tables). Put your list in handler,  modify it and use it from handler or take it out from handler and use on its own.\r\n#### Features:\r\n - List handler that works with python 2-dimensional lists.\r\n - Easy access to height and width of the table.\r\n - Simple handy functions: transposing and sorting.\r\n - Print your lists as tables to the console!\r\n## Examples:\r\n#### Creating table from list:\r\n```python\r\nimport PythonTableConsole as PTC\r\nmy_list = [['a', 'b', 'c'], [1, 2, 3], [7,4,3,2,0,10]]\r\nTable = PTC.PythonTableConsole(my_list)\r\n# or PTC.PythonTableConsole([['a', 'b', 'c'], [1, 2, 3], [7,4,3,2,0,10]])\r\n```\r\n#### Printing table to the console:\r\n```python\r\nprint(Table)\r\n'''\r\nresult:\r\n|a|1| 7|\r\n|b|2| 4|\r\n|c|3| 3|\r\n| | | 2|\r\n| | | 0|\r\n| | |10|\r\n'''\r\n```\r\n#### Changing table:\r\n```python\r\nTable.contains[0][0] = 'alpha'\r\n```\r\n#### Functions of the PythonTableConsole class:\r\n```python\r\nTable.width()  # returns number of columns\r\nTable.height()  # returns number of rows\r\nTable.transpose()  # transposes the Table: rows to columns, columns to rows\r\nTable.sort_by_column(column_index, skip_n_rows = 0)  # sorts the table (except first n rows) by specified column. MAY BE REMOVED IN THE FUTURE\r\nTable.sort_by_column_with_skips(column_index, skip_rows = [], skip_columns = [], largest_at_the_top = True)  # sorts the table (except specified rows and columns) by the specified column.\r\nTable.sort_by_row_with_skips(row_index, skip_rows = [], skip_columns = [], largest_at_the_top = True)  # sorts the table (except specified rows and columns) by the specified row.\r\n```\r\n\r\n## Other, uh... important? notes:\r\n#### Columns not rows\r\nPythonTableConsole handles inner lists as columns.\r\n```python\r\npos_x, pos_y = 0, 0\r\nTable.contains[pos_x][pos_y]  # not [pos_y][pos_x]\r\n```\r\nRow-centered handler may be implemented in the future. But for now you can transpose your tables to compensate for that handler absense.\r\n#### Updates are completely random\r\nThis is a pet-project so...\r\n\r\n## Planned features:\r\n#### Row-centered handler\r\nFor now only column-centered is present in this module.\r\n#### Width constrains for __str__\r\n - Default max width for table's columns\r\n - Max width for table's columns\r\n - Max widths (in list, idk) dor table's columns\r\n - \"New line or cut\" option (maybe with \"cut after n new_lines\" option)\r\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 Mykhailo Holub  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "Module for creating tables for console applications",
    "version": "1.3.7",
    "project_urls": {
        "Homepage": "https://github.com/MINIAProgramStudio/PythonTableConsole"
    },
    "split_keywords": [
        "console",
        "table"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e13e0aa56d1fbcf210ae2206844107aed9a186d72b6f6e8945604ad5a9bc101e",
                "md5": "b62fdb7741fab81b29a7ffc457bf9ffd",
                "sha256": "c801bb432f26fcbb6c3bd56b475213506abcfd17c3dc3b7b24f5b87c246a8ffa"
            },
            "downloads": -1,
            "filename": "PythonTaCo-1.3.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b62fdb7741fab81b29a7ffc457bf9ffd",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 5438,
            "upload_time": "2024-03-02T23:04:45",
            "upload_time_iso_8601": "2024-03-02T23:04:45.180755Z",
            "url": "https://files.pythonhosted.org/packages/e1/3e/0aa56d1fbcf210ae2206844107aed9a186d72b6f6e8945604ad5a9bc101e/PythonTaCo-1.3.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ff3fb60b96e19fb5afd93a5e5bba37f55c8544d4ba6211b68a2ed93818b8fc33",
                "md5": "dbe9ce7aa94ba006dd3f9c522ef03b13",
                "sha256": "b21bec55204148bf897ef77caccb675ab24dc47ae2a8335c8132e7f5510807f7"
            },
            "downloads": -1,
            "filename": "PythonTaCo-1.3.7.tar.gz",
            "has_sig": false,
            "md5_digest": "dbe9ce7aa94ba006dd3f9c522ef03b13",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 4680,
            "upload_time": "2024-03-02T23:04:47",
            "upload_time_iso_8601": "2024-03-02T23:04:47.558338Z",
            "url": "https://files.pythonhosted.org/packages/ff/3f/b60b96e19fb5afd93a5e5bba37f55c8544d4ba6211b68a2ed93818b8fc33/PythonTaCo-1.3.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-02 23:04:47",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "MINIAProgramStudio",
    "github_project": "PythonTableConsole",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "pythontaco"
}
        
Elapsed time: 3.38953s