Skip to content

dstrupl/cockroach

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

132 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cockroach will help you with your taxes

This small utility is for people using Charles Schwab brokerage and/or E-Trade services in the Czech Republic.

The program reads the Schwab JSON export of your stock transactions and optionally an E-Trade Gain and Loss CSV export, then creates a summary of your sales and purchases for the tax year.

Obtaining Schwab CSV export for last year

  1. Go to "Transaction History" tab.

  2. Choose "Equity Award Center" from the dropdown.

  3. Chose "Custom" Data range and interval from the last year (with overlap)

    • Some events (e.g. ESPP) are reported with delay, so overlap of several days is necessary.
    • Alternatively, you can export everything.
  4. Click "Export"

  5. Select "JSON" radio button, click "Export"

Obtaining E-Trade Gain and Loss XLSX export

  1. Go to Gains & Losses.

  2. Select Year 2025, Benefit type All, Capital Gain Status All, Covered Status All.

  3. Click DownloadDownload Expanded to export the data as XLSX.

  4. Save the xlsx into directory called 'sales'

Obtaining E-Trade ESPP confirmation PDFs

  1. Go to Stock Plan Confirmations.

  2. Select the relevant year and Benefit type: ESPP.

  3. Download all available confirmations.

  4. Save the PDFs into directory called 'espp'

Obtaining E-Trade RSU release confirmation PDFs

  1. Go to Stock Plan Confirmations.

  2. Select the relevant year and Benefit type: Restricted stock units.

  3. Download all available confirmations.

  4. Save the PDFs into directory called 'rsu'

Obtaining E-Trade Dividends XLSX export

  1. Go to Holdings.

  2. Scroll down to Other Holdings, expand it and then expand Cash transactions. Select the right date range. Don't tick "Dividends only" because you also want to see the withholding tax rows.

  3. Download the report as Excel.

  4. Save the XLSX file into directory called 'dividends'

Running the application

  • Compile and run cockroach/src/main/kotlin/cz/solutions/cockroach/CockroachMain.kt

  • it gets 3 required command line arguments - path to Schwab JSON export, year, and output dir. An optional 4th argument specifies the path to the E-Trade Gain and Loss CSV file.

  • it uses templates located here: cockroach/src/main/resources/cz/solutions/cockroach

  • the output are 4 simple .md files and an HTML guide

  • In InteliJ IDEA, you can convert the md files into pdf in Markdown export options under Tools > Markdown Converter menu.

Compiling and Running

mvn clean install -am

mvn clean install shade:shade

java -jar target/cockroach-0.2-SNAPSHOT.jar /tmp/219114411.json 2025 /tmp/taxes

With E-Trade data:

java -jar target/cockroach-0.2-SNAPSHOT.jar /tmp/219114411.json 2025 /tmp/taxes /tmp/e-trade-dir

Converting to PDF

  • pandoc sales_2021.md -V geometry:landscape --pdf-engine=/Library/TeX/texbin/pdflatex -o sales.pdf

  • IDEA: Tools -> Markdown Converter

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors