资本收益计算器
capital-gains的Python项目详细描述
资本收益
资本收益计算器。
这会将事务历史记录转换为适合IRS form 8949的格式,以处理清洗销售 调整。
注:逻辑对股份类型一无所知,不能解释交易等 ESPP、ISO和NSO的要素。您必须输入适当的成本基础 根据你的情况,例如在行使日的公平市价 ESPP取消处置资格。
安装
pip install capital-gains
用法
usage: capital-gains [<options>] [--] <input file>
Capital gains calculator
optional arguments:
-h, --help show this help message and exit
-d <n>, --decimal-places <n>
round $ to <n> decimal places; default: 0
-s <n>, --shares-decimal-places <n>
round shares to <n> decimal places; default: 0
-t, --totals output totals
-v, --verbose verbose output
-V, --version show program's version number and exit
输入格式
每个条目的格式如下:
date,symbol,name,shares,price,fee
买进有正的shares
;卖出有负的shares
。price
和fee
是
总是积极的。fee
和name
是可选的。没有name
的出售将
先卖出所有未平仓的地段;以name
卖出的地段将只卖出相同的地段
name
。因此name
可用于指定fifo以外的销售订单。
示例
capital-gains -t example/input.csv > example/output.txt
待办事项
- STCG与LTCG之比较