🍃 1099 Parser
Note: Dividend features are in beta. I haven't written tests yet. Use the
--analysis-reportflag to get more details about how decisions are made and double check my work.
Massive caveat: The parser is no longer compatible with Robinhood or Wealthfront for the 2023 tax year.
Both institutions have simplified their sales reports so that securities sold on a particular day but acquired on different days no have a separate line item for each of the dates acquired (and, in lieu of reporting any acquisition dates at all, the acquired date is simply 'Various'). This breaks the parser (which can be fixed) but more importantly removes a piece of information. Without date acquired, it's no longer possible to analyze (based purely on the consolidated 1099) whether dividends become unqualified.
This project converts standard 1099 tax documents (validated on Robinhood and Wealthfront documents so far) from PDF to CSV file. This tool will be helpful for those who need every transaction in a spreadsheet format for tax reporting purposes. After parsing the tax documents, it will perform some simple analysis on the holding period of securities which reported qualifying dividends.
Original Work
Copyright (c) 2023 Andrew Wells (ajwells@uchicago.com)
Original Author
Many kudos to original author Keun Park (kevin.park1217@gmail.com), whose work I used as a foundation upon which to expand.
🚀 Running Locally
Prerequisites
Make sure you have the following installed on your computer.
- Latest Python 3
Must be version 3.6 or higher - [Windows Only] Build Tools for Visual Studio 2019
In the installer, select- C++ build tools
- the Windows 10 SDK
- the latest version of MSVC v142 x64/x86 build tools.
Installing
$ python -m pip install wheel
$ python -m pip install --upgrade parse_1099
Note: If commands above fail, try replacing python with python3
Running
$ parse_1099
usage: parse_1099 [-h] --pdf FILE [--csv FILE] [--silent] [--validate] [--disable-dividend-analysis] [--analysis-report]
Example and Validation
Set the --validate flag to print out total values for some columns. Make sure these values match with the PDF!
$ parse_1099 --pdf consolidated_1099.pdf --validate
Pages: 100%|██████████████████████████████████████████████████████████████| 40/40 [00:03<00:00, 10.41it/s]
>>> Calculated Totals:
Make sure the values matches with the PDF totals!
proceeds: $77,521.03, cost: $80,902.05, wash_sales_loss: $3,733.41, gain_loss: $352.39
>>> Saved to output.csv
🐞 Issues and Bugs
If you have any issues with the tool, please open a GitHub Issue with as much as detail as you can provide.
Development
Structure
This is the first python module I've worked on, so the structure may be a little goofy. I tried to structure the project into two parsers, one for 1099-B Proceeds from Broker and Barter Exchange Transactions and one for 1099-DIV Detail for Dividends and Distributions.
In each case, I designed for extensibility via versioning, in case the structure of the data or the presentation of the data on the PDF ever changes. Hypothetically the correct version of the subparser could be detected, but there's no sense writing that functionality until the scenario arises.
Building
The following will build the python wheel file into the dist folder. Note that python and pip can be exchanged with python3 and pip3 depending on your environment configuration.
$ python -m build
The following will update the installed module requiring a version bump.
$ pip install dist/parse_1099-X.Y.Z-...whl --force-reinstall --no-deps
Metadata
Release files for parse-1099 2.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| parse_1099-2.1.2.tar.gz | 34.0 kB | Without provenance | Details for parse_1099-2.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| parse_1099-2.1.2-py3-none-any.whl | Python 3 | none | any | Details for parse_1099-2.1.2-py3-none-any.whl |
Total release size: 69.4 kB
Release files / parse_1099-2.1.2.tar.gz
| Download URL | parse_1099-2.1.2.tar.gz |
|---|---|
| Size | 34.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f8b61f364f22f715cf61a54afbf61dcd3b5a4faca11beef4b0dc1297e7ccf202
|
|
BLAKE2b-256 checksum How to use checksums |
45a44c36d15989a392652cd3b1ee7475e320d5890fd356120cbaaf058399a282
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.8.18
|
Release files / parse_1099-2.1.2-py3-none-any.whl
| Download URL | parse_1099-2.1.2-py3-none-any.whl |
|---|---|
| Size | 35.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
47d15104394706911e3926846eae5b138e4e7e437a73528403dee762ff68702f
|
|
BLAKE2b-256 checksum How to use checksums |
7459155aef0cd524ef91def54be969af48be334cbc7fa00d8212d7cbc4bd7ed0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.8.18
|
Security for parse-1099 2.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.