{"id":20740338,"url":"https://github.com/thecoder777/python-tables-new","last_synced_at":"2026-04-19T08:33:12.843Z","repository":{"id":254861654,"uuid":"195077417","full_name":"TheCoder777/Python-Tables-New","owner":"TheCoder777","description":"Python Table Module, but in a more object orientated style and more functionality.","archived":false,"fork":false,"pushed_at":"2019-12-17T13:01:25.000Z","size":48,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-11T11:54:55.604Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/TheCoder777.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,"publiccode":null,"codemeta":null}},"created_at":"2019-07-03T15:04:37.000Z","updated_at":"2019-07-21T12:35:06.000Z","dependencies_parsed_at":"2024-08-26T17:03:58.355Z","dependency_job_id":"e1119f97-de9d-4de3-ad1d-66e39c7474b7","html_url":"https://github.com/TheCoder777/Python-Tables-New","commit_stats":null,"previous_names":["thecoder777/python-tables-new"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TheCoder777/Python-Tables-New","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheCoder777%2FPython-Tables-New","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheCoder777%2FPython-Tables-New/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheCoder777%2FPython-Tables-New/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheCoder777%2FPython-Tables-New/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheCoder777","download_url":"https://codeload.github.com/TheCoder777/Python-Tables-New/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheCoder777%2FPython-Tables-New/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32000327,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-17T06:28:10.197Z","updated_at":"2026-04-19T08:33:12.821Z","avatar_url":"https://github.com/TheCoder777.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python Tables\n\nPython Tables is a module that let's you create and edit tables quickly. \n\nThe Python Table module uses two dimensional lists to provide table like functionality.\n\n\n\n## Installation\n\nTo install this module, you need to clone the repository to your download folder, (or somewhere else where you can find it again).\n\n```bash\ngit clone https://github.com/TheCoder777/Python-Tables-New.git\n```\n\n Now you need to copy the tables.py file to the main folder of your project.\n\n```bash\ncp ~/downloads/Python-Tables-New/tables.py ~/my_project/\n```\n\nFor example a structure like this:\n\n```bash\n.\n├── downloads\n│   └── Python-Tables-New\n│       ├── LICENSE\n│       └── tables.py\n└── my_project\n    ├── main_file.py\n    └── some_file.py\n```\n\nGoes to something like this:\n```bash\n.\n├── downloads\n│   └── Python-Tables-New\n│       ├── LICENSE\n│       └── tables.py\n└── my_project\n    ├── main_file.py\n    ├── some_file.py\n    └── tables.py\n```\n\n\nNow you can import the module in your main_file.py:\n\n```python\n# filename: main_file.py\nimport tables\n```\n\nYou successfully installed the module!\n\nPlease note that this is only for this one project. For other projects you need to copy the file again!\n\n\n\n## Usage\n\nIf the installation part was successful and you got no errors on import, you are good to go!\n\n\n\n### Reading and counting\n\nNote that in the whole module, you first start with the rows and continue with the columns!\n\nFor example:\n\n```python\n\t\t[[\t'item', 'item', 'item',  'item'\t], # row 0\n\t\t[\t'item', 'item', 'HELLO', 'item'\t], # row 1\n\t\t[\t'item', 'item', 'item',  'item'\t]] # row 2\n# column\t0\t\t1\t\t 2\t\t 3\n```\n\nSo for example the item 'HELLO' is at the first row and at the second column.\n\nYou start counting from the top to bottom, and then from left to right.\n\nLater in the functions, you always give the row as first, and the column as second parameter!\n\n\n\n### Create a Table\n\nTo create a table, you need to call the 'Table()' function.\n\n```python\nimport tables\n\nyour_table = tables.Table()\n```\n\nIf you want to give it a height (number of rows), or a length (number of columns) at this point, you can pass this to the function like this:\n\n```python\nheight = 2\nlength = 4\nyour_table = tables.Table(height, length)\n```\n\n\n\n### Printing a Table\n\nYou can easily print your table just by \"printing it as it is\".\n\n```python\nprint(your_table)\n```\n\nThis will print your table in a more Human readable format like this:\n\n```bash\nEmpty; Empty; Empty; Empty; |\nEmpty; Empty; Empty; Empty; |\n```\n\n\n\nYou can also show your table, by calling its 'show()' function.\n\n```python\nyour_table.show()\n```\n\nThis would output something like this:\n\n```python\n['Empty', 'Empty', 'Empty', 'Empty']\n['Empty', 'Empty', 'Empty', 'Empty']\n```\n\n'Empty' is the default value here.\n\n\n\n### Changing and inserting Values\n\n#### Default value:\n\nThe default Value can be set by using the 'val' parameter\n\n```python\nyour_table = tables.Table(val=\"Hello\")\n```\n\n\n\n#### Filling with values:\n\nTo fill your entire table with one value, you can use the 'fill()' function.\n\n```python\nyour_table.fill(\"Hello\")\n```\n\nIf you have want to fill the table with a list, the list will be applied to every row.\n\n```python\nyour_table.fill([\"Hello\", \"Hi\"])\n```\n\nIf the list is too long to fit the table, it will be cut away automatically.\n\n\n\n#### Insert values for rows/columns:\n\nYou can fill a row or a column with one value:\n\n```python\nyour_table.fill_row(1, \"Hello\") # fill row 1\n\nyour_table.fill_column(2, \"Hi\") # fill column 2\n```\n\nYou can also fill multiple rows/columns at once:\n\n```python\nyour_table.fill_row([1,2,3], \"Hello\") # fill rows 1, 2, 3\n\nyour_table.fill_column([2,3,4], \"Hi\") # fill columns 2, 3, 4\n```\n\nThe same applies if you have a list of values, independent of how many rows/columns you want to fill\n\n```python\nyour_table.fill_row([1,2,3], [\"Hello\", \"Hi\"]) # fill rows 1, 2, 3\n\nyour_table.fill_column(2, [\"Hello\", \"Hi\"]) # fill column 2\n```\n\n\n\n#### Insert value(s) at specific position:\n\nTo set a value to one specific item in your table, you can use the 'insert()' function:\n\n```python\nyour_table.insert(2, 1, \"Hello!\")\n```\n\nOf course you can insert a value to different items at once.\n\nThe only tricky thing is how you provide the positions right!\n\nYou have to put the positions, for example 1,3 and 2,4 in tuples or lists and then put it in a list or in a tuple:\n\n```python\nyour_table.insert(items=[[1,3], [2,4]], val=\"Hello!\") # lists in list\n\n# also works:\nyour_table.insert(items=([1,3], [2,4]), val=\"Hello!\") # lists in tuple\nyour_table.insert(items=[(1,3), (2,4)], val=\"Hello!\") # tuples in list\nyour_table.insert(items=((1,3), (2,4)), val=\"Hello!\") # tuples in tuple\n```\n\nNote that if you use the items list, you should use the 'val' variable to set the value.\n\nIf you want to add different values at different positions, you need to give a list with all values to the 'val' parameter:\n\n```python\nyour_table.insert(items=[[1,3], [2,4]], val=[\"Hello!\", \"World!\"])\n```\n\nThis will insert \"Hello!\" at position [1,3] and \"World!\" at position [2,4].\n\nAnother way to do this is by using the x- and y- coordinates in different lists:\n\n```python\ny = [1,2] # all y values (rows)\nx = [3,4] # all x values (columns)\nyour_table.insert(y, x, val=[\"Hello!\", \"World!\"])\n```\n\nDon't worry if one list (x, y, val) is too short or too long. The 'insert()' function will automatically crop it or fill missing values with default values.\n\n\n\n### Getting items\n\n#### Get entire table\n\nTo get the entire table as a data structure, you can just call the 'get()' function:\n\n```python\ndata = your_table.get()\n```\n\n'data' should look something like this, if you print it:\n\n```python\n\u003e\u003e\u003e print(data)\n[['Hello', 'Hello', 'Hello', 'Hello'],\n['Hello', 'Hello', 'Hello', 'Hello'],\n['Hello', 'Hello', 'Hello', 'Hello']]\n```\n\n\n\n#### Get a specific row or column\n\nTo get a specific row/column, you need to give the 'get()' function the 'row'/'column' argument:\n\n```python\nthird_row = your_table.get(row=2) # returns the second row\nsecond_column = your_table.get(column=1) # returns the first column\n```\n\nYou can also do this with multiple rows and columns:\n\n```python\nrows = your_table.get(row=(2,3)) # row 2,3\ncolumns = your_table.get(column=[1,3]) # column 1,3\n```\n\n\n\n#### Get specific item(s)\n\nIf you need to get a specific item from an exact position, you need the 'items' parameter:\n\n```python\nitem = your_table.get(items=(1,2)) # item from first row and second column\n```\n\nFor multiple items, you need to use tuple in list again (or similar):\n\n```python\nitems = your_table.get(items=[(1,2), (2,2)])\n```\n\n\n\n### Adding rows and columns\n\n#### Adding rows:\n\nTo add a row to your table, you have to call the 'add_row()' function:\n\n```python\nyour_table.add_row()\n```\n\nThis will add a row with default values to the last row of your table.\n\nTo use a different value, you can use the 'val' parameter:\n\n```python\nyour_table.add_row(val=\"Hello\")\n```\n\nIf you want your new row to be at the top, you can use the 'side' parameter:\n\n```python\nyour_table.add_row(side=\"Top\", val=\"Hello\")\n```\n\nYou can also place the row at a specific position (y-axis / between two rows) in your table, by using 'pos':\n\n```python\nyour_table.add_row(pos=3, val=\"Hello\")\n```\n\nTo choose if the new row goes under or over the current third row, you can use the 'side' parameter again (default value is \"Top\"), relative to the row 'pos' is pointing to:\n\n```python\nyour_table.add_row(pos=3, side=\"Bottom\", val=\"Hello\")\n```\n\nThis will place the new row under the current third row.\n\nAnd if you want more than one row added at the time, you can use the 'num' parameter:\n\n```python\nyour_table.add_row(pos=3, side=\"Bottom\", val=\"Hello\", num=4)\n```\n\nThis will add four new rows under the current third row, with \"Hello\" as value.\n\nIf you don't want to use one value for the entire row, you can just give the 'val' parameter a list or a tuple of values:\n\n```python\nyour_table.add_row(pos=3, side=\"Bottom\", val=[\"Hello\", \"what's\", \"up?\"])\n```\n\nThis will fill the first three cells with the three values, and then fill up with default values.\n\nIf the table has only a length of two, the function will crop the last value away! (The values are inserted from top to bottom!)\n\n\n\n#### Adding columns\n\nAdding a column is as simple as adding a row. Just call the 'add_column' function.\n\n```python\nyour_table.add_column()\n```\n\nThis will add a new column with default values at the right side of your table.\n\nIf you want to use a different value, you can use the 'val' parameter:\n\n```python\nyour_table.add_column(val=\"Hello\")\n```\n\nTo add the new column at the left of your table, you should use the 'side' parameter:\n\n```python\nyour_table.add_column(side=\"Left\", val=\"Hello\")\n```\n\nYou can also place the new column at a specific position (x-axis / between two columns) in your table, by using the 'pos' parameter as shown below.\n\n```python\nyour_table.add_column(pos=3, val=\"Hello\")\n```\n\nBy default this will add the new column at the left side of the current third column.\n\nTo change that, use the 'side' parameter again:\n\n```python\nyour_table.add_column(pos=3, side=\"Right\", val=\"Hello\")\n```\n\nNow this will insert the new column at the right side of the current third column.\n\nIf you want more than one column added at a time, the 'num' parameter will be your friend!\n\n```python\nyour_table.add_column(pos=3, side=\"Right\", val=\"Hello\", num=4)\n```\n\nThis will now add 3 columns at the right side of the current third column, instead of one.\n\nIf you need to use more values at a time, you can just give the 'val' parameter a list or a tuple of values:\n\n```python\nyour_table.add_column(pos=3, side=\"Right\", val=[\"Hello\", \"what's\", \"up?\"])\n```\n\nNow this will fill the first three cells of the table with the three given values, and then fill the rest with default values. If the table has only a hight of two, it will crop the last value away automatically! (The values are inserted from left to right!)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecoder777%2Fpython-tables-new","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthecoder777%2Fpython-tables-new","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecoder777%2Fpython-tables-new/lists"}