{"id":24741,"library":"tsv2py","title":"tsv2py","description":"High-performance parser and generator for PostgreSQL-compatible tab-separated values (TSV). Current version 0.7.1, requires Python >=3.8. Release cadence is irregular (last release 2025-01).","status":"active","version":"0.7.1","language":"python","source_language":"en","source_url":"https://github.com/hunyadi/tsv2py","tags":["tsv","parser","generator","postgresql","high-performance"],"install":[{"cmd":"pip install tsv2py","lang":"bash","label":"latest release"}],"dependencies":[],"imports":[{"note":"tsv2py is a module, not a class; correct usage is tsv2py.TsvParser or tsv2py.TsvGenerator.","wrong":"from tsv2py import tsv2py","symbol":"tsv2py","correct":"import tsv2py"}],"quickstart":{"code":"import tsv2py\n\n# Parse TSV string\ndata = \"col1\\tcol2\\n1\\t2\"\nfor row in tsv2py.TsvParser(data):\n    print(row)\n\n# Generate TSV string\ng = tsv2py.TsvGenerator()\ng.append([\"a\", \"b\"])\nprint(g.finish())","lang":"python","description":"Parse TSV data from string and generate TSV output."},"warnings":[{"fix":"Replace TsvReader with TsvParser and adapt interface (e.g., rows via iteration).","message":"In version 0.7.0, the API changed from classes like TsvReader to TsvParser and TsvGenerator. Old code using TsvReader will break.","severity":"breaking","affected_versions":"<0.7.0"},{"fix":"Use open(filename, 'r') to create a file object and pass it to TsvParser.","message":"The option to read TSV from file paths directly in the constructor was deprecated; use file-like objects.","severity":"deprecated","affected_versions":">=0.7.0"},{"fix":"Always open file first: with open(path) as f: TsvParser(f).","message":"TsvParser expects TSV data as string or file object, not a file path. Passing a path will raise TypeError.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use open('file.tsv') or provide the TSV content as a string.","cause":"Passing a file path string instead of a file object or TSV content string.","error":"TypeError: TsvParser expected a string or file-like object, not a path"},{"fix":"Use tsv2py.TsvParser instead.","cause":"TsvReader was removed in version 0.7.0.","error":"AttributeError: module 'tsv2py' has no attribute 'TsvReader'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}