Skip to content

Commit d96dfa0

Browse files
authored
Update documentation (#65)
1 parent adf298d commit d96dfa0

4 files changed

Lines changed: 23 additions & 10 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Browse to http://127.0.0.1:8080/
4949
## Python API
5050

5151
```python
52-
from ibkr_report.report import Report
52+
from ibkr_report import Report
5353

5454
FILE_1 = "test-data/data_single_account.csv"
5555
FILE_2 = "test-data/data_multi_account.csv"
@@ -73,7 +73,7 @@ for item in report.details:
7373
```
7474

7575
```python
76-
from ibkr_report.exchangerates import ExchangeRates
76+
from ibkr_report import ExchangeRates
7777

7878
rates = ExchangeRates()
7979
print(rates.get_rate("EUR", "USD", "2020-06-20"))

ibkr_report/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
from flask import Flask
1717

1818
from ibkr_report import cron, website
19+
from ibkr_report.exchangerates import ExchangeRates
20+
from ibkr_report.report import Report
21+
22+
__all__ = ["create_app", "ExchangeRates", "Report"]
1923

2024

2125
def create_app() -> Flask:

ibkr_report/report.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,24 @@ class Report:
2525
"""Total selling prices, total capital gains, and total capital losses
2626
calculated from the CSV files.
2727
28+
When calculating the amount of profit or loss, you can deduct the deemed
29+
acquisition cost from the selling price of the shares, instead of deducting
30+
the purchase price of the shares as well as the expenses incurred in
31+
making a profit.
32+
2833
Args:
29-
file (Iterable[bytes]): The input file in CSV format
30-
report_currency (str): The currency used in the output
31-
use_deemed_acquisition_cost (bool): Whether to use acquisition cost
34+
file (Iterable[bytes]): The input file in CSV format.
35+
report_currency (str): The currency used in the output.
36+
use_deemed_acquisition_cost (bool): Whether to use the deemed acquisition cost
37+
if it benefits you.
3238
3339
Attributes:
34-
prices (Decimal): Total selling prices
35-
gains (Decimal): Total capital gains
36-
losses (Decimal): Total capital losses
37-
details(List): Details from trades such as dates and quantities
38-
options (ReportOptions): Whether to use acquisition cost, report currency
40+
prices (Decimal): Total selling prices.
41+
gains (Decimal): Total capital gains.
42+
losses (Decimal): Total capital losses.
43+
details(List): Details from trades such as dates and quantities.
44+
options (ReportOptions): Report currency, whether to use the deemed
45+
acquisition cost.
3946
"""
4047

4148
prices: Decimal = Decimal(0)

ibkr_report/trade.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ def deemed_profit(sell_price: Decimal, buy_date: str, sell_date: str) -> Decimal
149149
acquisition cost is 20% of the selling price of the shares.
150150
If you have owned the shares you sell for at least 10 years, the deemed
151151
acquisition cost is 40% of the selling price of the shares.
152+
153+
https://www.vero.fi/en/individuals/property/investments/selling-shares/
152154
"""
153155
multiplier = Decimal(0.8)
154156
if get_date(buy_date) <= add_years(get_date(sell_date), -10):

0 commit comments

Comments
 (0)