{"id":17797349,"url":"https://github.com/mbrukman/csv2txf","last_synced_at":"2025-10-14T16:55:10.962Z","repository":{"id":46121037,"uuid":"194743606","full_name":"mbrukman/csv2txf","owner":"mbrukman","description":"Convert stock sales from CSV to TXF for easy import into TurboTax","archived":false,"fork":false,"pushed_at":"2025-09-08T17:10:44.000Z","size":65,"stargazers_count":13,"open_issues_count":2,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-09-08T18:13:28.404Z","etag":null,"topics":["csv","interactive-brokers","taxes","td-ameritrade","tdameritrade","turbotax","txf","vanguard"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mbrukman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-07-01T21:12:02.000Z","updated_at":"2025-09-08T17:10:46.000Z","dependencies_parsed_at":"2024-08-02T03:46:25.990Z","dependency_job_id":"a40683f9-5bda-46e2-ac15-708955f29f85","html_url":"https://github.com/mbrukman/csv2txf","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/mbrukman/csv2txf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrukman%2Fcsv2txf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrukman%2Fcsv2txf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrukman%2Fcsv2txf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrukman%2Fcsv2txf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mbrukman","download_url":"https://codeload.github.com/mbrukman/csv2txf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrukman%2Fcsv2txf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279019590,"owners_count":26086759,"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-10-14T02:00:06.444Z","response_time":60,"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":["csv","interactive-brokers","taxes","td-ameritrade","tdameritrade","turbotax","txf","vanguard"],"created_at":"2024-10-27T11:54:01.965Z","updated_at":"2025-10-14T16:55:10.956Z","avatar_url":"https://github.com/mbrukman.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# csv2txf\n\n[![Tests status][tests-badge]][tests-url]\n[![Typecheck status][typecheck-badge]][typecheck-url]\n[![Lint checks][lint-badge]][lint-url]\n\n[tests-badge]: https://github.com/mbrukman/csv2txf/actions/workflows/tests.yaml/badge.svg?query=branch%3Amain\n[tests-url]: https://github.com/mbrukman/csv2txf/actions/workflows/tests.yaml?query=branch%3Amain\n[typecheck-badge]: https://github.com/mbrukman/csv2txf/actions/workflows/typecheck.yaml/badge.svg?query=branch%3Amain\n[typecheck-url]: https://github.com/mbrukman/csv2txf/actions/workflows/typecheck.yaml?query=branch%3Amain\n[lint-badge]: https://github.com/mbrukman/csv2txf/actions/workflows/lint.yaml/badge.svg?query=branch%3Amain\n[lint-url]: https://github.com/mbrukman/csv2txf/actions/workflows/lint.yaml?query=branch%3Amain\n\n## Overview\n\nThis package implements a simple converter from CSV files produced by brokers\nwhich include buy/sell transactions to the TXF format for import into tax\nsoftware such as TurboTax.\n\nUsage:\n\n```\n./csv2txf.py -f testdata/vanguard.csv --broker vanguard --year 2010\n```\n\nThe converter internally converts broker-specific CSV format to a\nbroker-independent internal representation, and then pretty-prints the data in\nTXF format, thus making it easy to add support for additional brokers.\n\nCurrently-supported brokers are:\n\n* Interactive Brokers\n* TD Ameritrade\n* Vanguard\n\n## Caveats\n\n1. This code is being provided as-is, in the hope that it will be useful, but\n   without guarantees of correctness, so please be sure to verify that the\n   output (and imported contents into your tax software) match your\n   expectations.\n\n   Verifying the correctness of the data entered should be easier and less\n   tedious than manually entering it.\n\n2. This code was originally written in 2012 and has not been tested or updated\n   since; if the non-standardized CSV format for any of the brokers has changed\n   since then, you'll need to update it (and please add tests!).\n\n3. You may need to pre-process the CSV manually, or in your broker-specific\n   importer to handle reconciliation and lot match-ups, which leads to the\n   requirement that buy/sell pairs are consecutive and must match in security\n   and number of shares.\n\n   For a simple example, consider this sequence of transactions:\n\n   ```\n   BUY 100 shares ABC\n   BUY 100 shares XYZ\n   SELL 100 shares ABC\n   SELL 100 shares XYZ\n   ```\n\n   You might say (correctly) that this is unambiguous and that having them\n   listed consecutively is just extra work:\n\n   ```\n   BUY 100 shares ABC\n   SELL 100 shares ABC\n   BUY 100 shares XYZ\n   SELL 100 shares XYZ\n   ```\n\n   but look at what happens when the situation is just slightly more complex:\n\n   ```\n   BUY 100 shares ABC @150 2002/10/10\n   BUY 100 shares ABC @100 2002/10/15\n   SELL 100 shares ABC @100 2003/10/10\n   SELL 100 shares ABC @200 2003/10/11\n   ```\n\n   Here, by matching in FIFO mode, you'll come up with a different result than if\n   you meant to do SpecId, with different long-term vs. short-term gains.\n\n   This is further complicated if you buy larger lots and sell piece-wise, e.g.:\n\n   ```\n   BUY 200 shares ABC @150 2002/10/10\n   SELL 100 shares ABC @100 2003/10/10\n   SELL 100 shares ABC @200 2003/10/11\n   ```\n\n   which is why you need to do the pre-processing yourself to identify the lots,\n   their cost basis, and the proceeds, and let the TXF printer just output what\n   you have decided to use as your cost basis format.\n\n   Unfortunately, CSV formats are not standardized amongst the brokers and may\n   change at any time, so some custom (re-)formatting may be required for your\n   broker's output.\n\n## Contributing\n\nSee [`CONTRIBUTING.md`](CONTRIBUTING.md) for details.\n\n## License\n\nApache 2.0; see [`LICENSE`](LICENSE) for details.\n\n## Disclaimer\n\nThis project is not an official Google project. It is not supported by Google\nand Google specifically disclaims all warranties as to its quality,\nmerchantability, or fitness for a particular purpose.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbrukman%2Fcsv2txf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmbrukman%2Fcsv2txf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbrukman%2Fcsv2txf/lists"}