Code Monkey home page Code Monkey logo

convert-csv-schwab2pp's Introduction

A Charles Schwab CSV Converter for Portfolio Performance

Python CI Last commit date Eclipse Public License - v 2.0

Converts a Charles Schwab transaction CSV file to a ready-to-import CSV file for Portfolio Performance (PP).

After conversion, this step-by-step guide creates a new portfolio file in PP and imports the converted example CSV.

Usage

There are two ways to run this tool: Google Colab or via command-line. The former is for end-users. The later is for python-savvy users and developers.

Usage via Google Colab

Although Google Colab is free, one will need a Google account.

Open in Colab

Usage via command-line

Runtime Requirements:

  • Python 3.7, 3.8, 3.9 or 3.101
  • Pandas

Install this tool in a Python virtual environment:

  1. pyenv
  2. pyenv-virtualenv

Install runtime libraries:

pip install -r requirements.txt

Command-line options:

python convert.py --help
usage: convert.py [-h] [-p PP_CSV] schwab_csv

Converts a Charles Schwab transaction CSV file to a ready-to-import CSV file for Portfolio
Performance.

positional arguments:
  schwab_csv            Input Charles Schwab CSV file

optional arguments:
  -h, --help            show this help message and exit
  -p PP_CSV, --pp_csv PP_CSV
                        Resulting CSV file for Portfolio Performance (default: pp.csv)

Example:

An example Schwab CSV: example.csv. The converted ready-to-import CSV file: example_out.csv.

To replicate this conversion:

python convert.py example.csv -p example_out.csv

Details

Supported transactions:

  • "NRA Tax Adj"
  • "Credit Interest"
  • "NRA Withholding"
  • "Short Term Cap Gain"
  • "Long Term Cap Gain"
  • "Cash Dividend"
  • "Buy"
  • "Wire Received"
  • "Sell" (Not verified)

Not-yet-supported transactions:

  • ACH deposit and withdrawal
  • Wire withdrawal

I have actual transactions for the supported transactions. "Sell" is an educated guess; I don't have an actual sale. If you could share actual transactions for not-yet-supported ones, please let me know. Thank you.

Duplicate transactions:

As far as I can test, PP will detect and skip duplicate transactions. So it is safe to import overlapping transactions in the future.

License

MIT

Footnotes

  1. Python 3.11 not yet officially supported by Pandas, as of 2022-11-15.

convert-csv-schwab2pp's People

Contributors

austin-540 avatar rlan avatar sdtom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

sdtom

convert-csv-schwab2pp's Issues

Support ACH transactions

Money transactions from an US bank would be via ACH, i.e., ACH deposit and ACH withdrawal. I currently have no such transaction records.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.