Skip to main content

Capital gains calculator

Project description

capital-gains

Capital gains calculator.

Installation

pip install capital-gains

Usage

usage: capital-gains [<options>] [--] <input file>

Capital gains calculator

optional arguments:
  -h, --help     show this help message and exit
  --cents        round to nearest cents, not dollars
  -v, --version  show program's version number and exit

Input format

See example/input.csv.

Each entry has the following format:

date,symbol,name,shares,price,fee

Buys have positive shares; sells have negative shares. price and fee are always positive. fee and name are optional. A sell without a name will sell all open lots FIFO; a sell with a name will only sell lots with the same name. Thus name can be used to specify sell orders other than FIFO.

Output format

Closed lots are tabulated in a format suitable for form 8949, rounded to the nearest dollar (use --cents to round to the nearest cent).

Open lots are also summarized.

Examples

capital-gains example/input.csv > example/output.txt

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

capital-gains-1.0.0.tar.gz (4.0 kB view hashes)

Uploaded source

Built Distribution

capital_gains-1.0.0-py2.py3-none-any.whl (5.5 kB view hashes)

Uploaded py2 py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page