{"id":21436729,"url":"https://github.com/mezantrop/tssplit","last_synced_at":"2025-07-27T07:30:34.088Z","repository":{"id":62585424,"uuid":"250802106","full_name":"mezantrop/tssplit","owner":"mezantrop","description":"Python trivial split for strings with quotes and escaped characters","archived":false,"fork":false,"pushed_at":"2024-12-25T17:31:25.000Z","size":37,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-05T05:51:37.474Z","etag":null,"topics":["escape-char","escaped-characters","python","quotes","split","string-manipulation","trim"],"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":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":"2020-03-28T13:28:58.000Z","updated_at":"2024-12-25T17:29:54.000Z","dependencies_parsed_at":"2024-12-07T06:00:58.446Z","dependency_job_id":null,"html_url":"https://github.com/mezantrop/tssplit","commit_stats":{"total_commits":31,"total_committers":1,"mean_commits":31.0,"dds":0.0,"last_synced_commit":"d17b5fd6274d88e5af423870adfb09a3a552d16e"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/mezantrop/tssplit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mezantrop%2Ftssplit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mezantrop%2Ftssplit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mezantrop%2Ftssplit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mezantrop%2Ftssplit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mezantrop","download_url":"https://codeload.github.com/mezantrop/tssplit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mezantrop%2Ftssplit/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267324219,"owners_count":24069351,"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","status":"online","status_checked_at":"2025-07-27T02:00:11.917Z","response_time":82,"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":["escape-char","escaped-characters","python","quotes","split","string-manipulation","trim"],"created_at":"2024-11-23T00:14:15.106Z","updated_at":"2025-07-27T07:30:34.082Z","avatar_url":"https://github.com/mezantrop.png","language":"Python","funding_links":["https://www.buymeacoffee.com/mezantrop"],"categories":[],"sub_categories":[],"readme":"# Trivial split for strings with multiple character delimiters, quotes and escaped characters\n\n[![Downloads](https://pepy.tech/badge/tssplit/month)](https://pepy.tech/project/tssplit)\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## Installation\n\n```shell script\npip install tssplit\n```\n\n## Usage\n\n### Syntax\n\n```Python3\ndef tssplit(s:str, quote:str='\"\\'', quote_keep:bool=False, delimiter:str=':;,', escape:str='/^',\n            trim:str='', remark:str='#') -\u003e list[str]:\n\n    \"\"\"Split a string by delimiters with quotes and escaped characters, optionally trimming results\n\n    :param s: A string to split into chunks\n    :param quote: Quote chars to protect a part of s from parsing\n    :param quote_keep: Preserve quote characters in the output or not\n    :param delimiter: A chunk separator character\n    :param escape: An escape character\n    :param trim: Trim characters from chunks\n    :param remark: Ignore all characters after remark sign\n    :return: A list of chunks\n    \"\"\"\n```\n\n### Example\n\n```Python3\nimport tssplit\n\ntssplit('--:--;--,--\"--/--\"--\\'--:--\\'--/\"--^--',\n        quote='\"\\'', delimiter=':;,', escape='/^', trim='')\n['--', '--', '--', '----/------:----\"----']\n\ntssplit('--:--;--,--\"--/--\"--\\'--:--\\'--/\"--^--',\n        quote='\"\\'', delimiter=':;,', escape='/^', trim='', quote_keep=True)\n['--', '--', '--', '--\"--/--\"--\\'--:--\\'--\"----']\n\ntssplit('--:--;--,--\"--/--\"--\\'--:--\\'--# Ignore this',\n        quote='\"\\'', delimiter=':;,', escape='/^', trim='', quote_keep=True, remark='#')\n['--', '--', '--', '--\"--/--\"--\\'--:--\\'--']\n```\n\n## Changelog\n\n* 2020.03.28    v1.0    Initial release\n* 2020.03.28    v1.0.1  Many quick fixes to make all things work in PyPI\n* 2020.03.29    v1.0.2  Minor fixes, Readme update, Long description provided\n* 2020.03.29    v1.0.3  Trim option to strip() characters from chunks\n* 2020.03.29    v1.0.4  Multiple characters for quotes, delimiters and escapes\n* 2022.02.04    v1.0.5  Added `quote_keep` option to preserve quote marks in the output or not\n* 2023.01.12    v1.0.6  Remark characters interrupt string parsing\n* 2024.04.03    v1.0.7  Cosmetics to make pylint happy\n* 2024.10.19    v1.0.8  Better module import; minor cosmetic changes\n* 2024.12.25    v1.0.9  Type annotations by @mkupferman + misc minor changes\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmezantrop%2Ftssplit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmezantrop%2Ftssplit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmezantrop%2Ftssplit/lists"}