{"id":22021861,"url":"https://github.com/mezantrop/tsqlike","last_synced_at":"2026-01-24T10:04:50.419Z","repository":{"id":243026099,"uuid":"811255394","full_name":"mezantrop/tSQLike","owner":"mezantrop","description":"SQL-like interface to tabular structured data","archived":false,"fork":false,"pushed_at":"2024-11-01T17:14:00.000Z","size":137,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-07T06:43:32.600Z","etag":null,"topics":["csv","data-processing","data-structures","json","python","sql-like","table"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mezantrop.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2024-06-06T08:40:42.000Z","updated_at":"2024-11-01T17:14:03.000Z","dependencies_parsed_at":"2024-10-24T17:09:28.242Z","dependency_job_id":null,"html_url":"https://github.com/mezantrop/tSQLike","commit_stats":null,"previous_names":["mezantrop/tsqlike"],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/mezantrop/tSQLike","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mezantrop%2FtSQLike","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mezantrop%2FtSQLike/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mezantrop%2FtSQLike/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mezantrop%2FtSQLike/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mezantrop","download_url":"https://codeload.github.com/mezantrop/tSQLike/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mezantrop%2FtSQLike/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28724374,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T08:27:05.734Z","status":"ssl_error","status_checked_at":"2026-01-24T08:27:01.197Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["csv","data-processing","data-structures","json","python","sql-like","table"],"created_at":"2024-11-30T06:15:41.106Z","updated_at":"2026-01-24T10:04:50.404Z","avatar_url":"https://github.com/mezantrop.png","language":"Python","funding_links":["https://www.buymeacoffee.com/mezantrop"],"categories":[],"sub_categories":[],"readme":"# tSQLike\n\n[![Python package](https://github.com/mezantrop/tSQLike/actions/workflows/python-package.yml/badge.svg)](https://github.com/mezantrop/tSQLike/actions/workflows/python-package.yml)\n[![CodeQL](https://github.com/mezantrop/tSQLike/actions/workflows/codeql.yml/badge.svg)](https://github.com/mezantrop/tSQLike/actions/workflows/codeql.yml)\n\n## SQL-like interface to tabular structured data\n\n\u003ca href=\"https://www.buymeacoffee.com/mezantrop\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/default-orange.png\" alt=\"Buy Me A Coffee\" height=\"41\" width=\"174\"\u003e\u003c/a\u003e\n\n## Description\n\n**tSQLike** is a `Python3` module that is written with a hope to make tabular data processing easier using SQL-like primitives.\n\n## Notes\n\n**Not that early stage, but still in development: may contain bugs**\n\n## Usage\n\n```Python3\nimport tsqlike\n\nt1 = tsqlike.Table(data=[['h1', 'h2', 'h3', 'h4'],\n                        ['a', 'b', 'c', 'd'],\n                        ['b', 'c', 'd', 'd'],\n                        ['f', 'g', 'h', 'i']],\n                   name='first')\nt2 = tsqlike.Table().import_list_dicts(data=[{'h1': 1, 'h2': 2, 'h3': 3},\n                                            {'h1': 'd', 'h2': 'e', 'h3': 'f'}],\n                                       name='second')\nt3 = t1.join(t2, on='first.h4 == second.h1').select('*').order_by('second.h2', direction=tsqlike.ORDER_BY_DEC)\nt3.write_csv(dialect='unix')\n\n\"first.h1\", \"first.h2\", \"first.h3\", \"first.h4\", \"second.h1\", \"second.h2\", \"second.h3\"\n\"b\", \"c\", \"d\", \"d\", \"d\", \"e\", \"f\"\n\"a\", \"b\", \"c\", \"d\", \"d\", \"e\", \"f\"\n```\n\n## Installation\n\n```sh\npip install tsqlike\n```\n\n## Functionality\n\n### Table class\n\nThe main class of the module\n\n#### Data processing methods\n\n| Name        | Status  | Description                                                                                |\n|-------------|---------|--------------------------------------------------------------------------------------------|\n| `column_map`| \u0026#9745; | Apply a function to a column                                                               |\n| `join`      | \u0026#9745; | Join two Tables (`self` and `table`) on an expression [*](#Warning). Complex, but **slow** |\n| `join_lt`   | \u0026#9745; | Light, limited, **fast** and safe `Join`, that doesn't use `eval()`                        |\n| `select`    | \u0026#9745; | Select column(s) from the `Table` [*](#Warning)                                            |\n| `select_lt` | \u0026#9745; | `eval()`-free version of select                                                            |\n| `order_by`  | \u0026#9745; | ORDER BY primitive of SQL SELECT to sort the Table by a column                             |\n| `group_by`  | \u0026#9745; | GROUP BY primitive of SQL SELECT to apply aggregate function on a column                   |\n\n#### Import methods\n\n| Name                | Status  | Description                                                             |\n|---------------------|---------|-------------------------------------------------------------------------|\n| `import_dict_lists` | \u0026#9745; | Import a dictionary of lists into Table object                          |\n| `import_list_dicts` | \u0026#9745; | Import a list of horizontal arranged dictionaries into the `Table`      |\n| `import_list_lists` | \u0026#9745; | Import `list(list_1(), list_n())` with optional first row as the header |\n\n#### Export methods\n\n| Name                | Status  | Description                                                             |\n|---------------------|---------|-------------------------------------------------------------------------|\n| `export_dict_lists` | \u0026#9745; | Export a dictionary of lists                                            |\n| `export_list_dicts` | \u0026#9745; | Export list of dictionaries                                             |\n| `export_list_lists` | \u0026#9745; | Export `list(list_1(), list_n())` with optional first row as the header |\n\n#### Write methods\n\n| Name            | Status  | Description                                                         |\n|-----------------|---------|---------------------------------------------------------------------|\n| `write_csv`     | \u0026#9745; | Make `CSV` from the `Table` object and write it to a file or stdout |\n| `write_json`    | \u0026#9745; | Write `JSON` into file or `STDOUT` [*](#Warning)                    |\n| `write_json_lt` | \u0026#9745; | `eval()`-free version of `Table.write_json`                         |\n| `write_xml`     | \u0026#9744; | Write `XML`. NB: Do we need this?                                   |\n\n#### Header manipulation methods\n\n| Name              | Status  | Description                                                                |\n|-------------------|---------|----------------------------------------------------------------------------|\n| `get_column`      | \u0026#9745; | Return either a column name by index or index by name. None if not found   |\n| `rename_column`   | \u0026#9745; | Rename a column name in the header                                         |\n| `make_shortnames` | \u0026#9745; | Return Header with no Dot-prefix of the columns                            |\n| `set_shortnames`  | \u0026#9745; | Remove Dot-prefix of the columns from self/Table header                    |\n\n#### Private methods\n\n| Name           | Status  | Description                               |\n|----------------|---------|-------------------------------------------|\n| `_redimension` | \u0026#9745; | Recalculate dimensions of the Table.table |\n\n### EvalCtrl class\n\nControls what arguments are available to `eval()` function\n\n| Name               | Status  | Description                                              |\n|--------------------|---------|----------------------------------------------------------|\n| `blacklisted`      | \u0026#9745; | Checks if there is any of the blacklised words in stanza |\n| `blacklist_add`    | \u0026#9745; | Add a new word into the black list                       |\n| `blacklist_remove` | \u0026#9745; | Remove the word from the blacklist                       |\n\n### Standalone functions\n\n| Name          | Status  | Description                                                |\n|---------------|---------|------------------------------------------------------------|\n| `open_file`   | \u0026#9745; | Open a file                                                |\n| `close_file`  | \u0026#9745; | Close a file                                               |\n| `read_json`   | \u0026#9745; | Read `JSON` file                                           |\n| `read_csv`    | \u0026#9745; | Read `CSV` file                                            |\n| `read_xml`    | \u0026#9744; | Read `XML`. NB: Do we need XML support?                    |\n| `str_to_type` | \u0026#9745; | Convert a `str` to a proper type: `int`, `float` or `bool` |\n\n#### WARNING\n\nMethods `Table.join(on=)`, `Table.select(where=)` and `Table.write_json(export_f=)`, use `eval()` function\nto run specified expressions within the program. **ANY** expression, including one that is potentially **DANGEROUS**\nfrom security point of view, can be passed as the values of the above arguments. It is your duty to ensure correctness\nand safety of these arguments and `EvalCtrl` helps to block potentially dangerous function/method names.\n\nAlternatively you can use `Table.join_lt()`, `Table.select_lt()` and `Table.write_json()`. They are significantly less\npowerful, but do not use `eval()`.\n\n## TODO\n\n* Rework: Table Names, Header Column Names, Dot-Prefixes\n* Documentation!\n\n## Contacts\n\nIf you have an idea, a question, or have found a problem, do not hesitate to open an issue or mail me directly:\nMikhail Zakharov \u003czmey20000@yahoo.com\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmezantrop%2Ftsqlike","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmezantrop%2Ftsqlike","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmezantrop%2Ftsqlike/lists"}