Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
JakubFranek committed Mar 29, 2024
2 parents 88233b0 + a60b375 commit 959124f
Show file tree
Hide file tree
Showing 63 changed files with 1,015 additions and 160 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Kapytal is a PyQt-based Windows tool for managing your personal or household fin
- 14 powerful [Transaction filters](./docs/glossary.md#transaction-filters-) for precise Report data set control
- and much more...

![Youtube Icon](./resources/icons/icons-16/film-youtube.png) [Click here to watch Kapytal Showcase video on YouTube!](https://youtu.be/EUVaSDxPzxs) ![Youtube Icon](./resources/icons/icons-16/film-youtube.png)
![Youtube Icon](./resources/icons/icons-16/film-youtube.png) [Click here to watch Kapytal Showcase video on YouTube!](https://youtu.be/CDf4pf7hMgg) ![Youtube Icon](./resources/icons/icons-16/film-youtube.png)

## Requirements

Expand All @@ -32,3 +32,7 @@ Kapytal is a PyQt-based Windows tool for managing your personal or household fin
- [Glossary](/docs/glossary.md)
- [FAQ](/docs/faq.md)
- [Screenshots](/docs/screenshots.md)

---

*Dedicated to my wife Soňa*
16 changes: 15 additions & 1 deletion docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ The following questions are not ordered in any particular way.
* [Why did you choose PyQt?](#why-did-you-choose-pyqt)
* [What is Kapytal's performance like? How many Transactions can it handle?](#what-is-kapytals-performance-like-how-many-transactions-can-it-handle)
* [Can I contribute?](#can-i-contribute)
* [Why does Kapytal save data in a JSON format?](#why-does-kapytal-save-data-in-a-json-format)
* [How long did it take to create Kapytal?](#how-long-did-it-take-to-create-kapytal)

---

Expand Down Expand Up @@ -136,6 +138,8 @@ Kapytal allows you to use both approaches, so it is up to you. However, if you e

The Total Currency Gain column in the Securities Overview tree quantifies the impact of the [Exchange Rate](./glossary.md#exchange-rate-) fluctuations on the Total Base Gain. The value of Total Currency Gain is equal to the difference between the Total Base Gain and the Total Native Gain, after converting Total Native Gain to base Currency using the latest Exchange Rate.

For more details into Securities Form Overview tab calculations, see [Securities Form](./glossary.md#securities-form) in the glossary.

---

### How should I handle stock splits?
Expand Down Expand Up @@ -176,7 +180,7 @@ I wanted to learn a GUI framework which is reliable, well maintained and feature

There are many places in Kapytal's codebase which I optimized as much as I could (caching, using optimal data structures, rigorous line-by-line profiling etc). My main [data file](./glossary.md#data-file) is over 5 000 [Transactions](./glossary.md#transaction) long now and the performance is completely fine with file load taking usually less than 2 seconds.

I also tested Kapytal with files up to 100 thousand Transactions, which I think is the upper limit for most use cases (100 000 Transactions is about 5 Transactions per day for 60 years). The file load and save times get longer with so many Transactions (up to 2 minutes), but the tool remains useable.
I also tested Kapytal with files up to 100 thousand Transactions, which I think is the upper limit for most use cases (100 000 Transactions is about 5 Transactions per day for 60 years). The file load and save times get longer with so many Transactions (up to 1 minute on my laptop), but the tool remains useable.

If it ever becomes necessary, I can try to optimize the worst performance offenders sometime down the road.

Expand All @@ -187,3 +191,13 @@ If it ever becomes necessary, I can try to optimize the worst performance offend
If you want to contribute, let me know, but Kapytal was always intended to be a solo project, so I can't promise anything. You can fork the project freely though. If you do so, please give credit, link the original repository and indicate any changes you made. If they are any good I might port them to the original project :^)

---

### Why does Kapytal save data in a JSON format?

I chose JSON because it is well-established, human-readable/editable and easy to work with. For example, if required, it seems easier to me to write a script for translating Kapytal JSON file to some other software's data format rather than working with a relational database. Admittedly, I have zero database experience, so I might be completely off the mark :(

---

### How long did it take to create Kapytal?

According to my [ActivityWatch](https://activitywatch.net/), between November 30th 2022 (when the development started) and February 15th 2024 (today), I spent 735 hours in VS Code, Qt Creator, googling programming related topics and editing images or videos for Kapytal. This is about 1 hour and 40 minutes per day on average. Needless to say, I spent many more uncounted hours working on Kapytal in my mind!
53 changes: 45 additions & 8 deletions docs/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,13 @@ Evaluated quantities are:
+ same as Inward Transfers, but for value flowing out of the selected Account Items into the unselected Account Items
+ Total Outflow
+ Cash Flow
+ equal to $ \text{Total Inflow} - \text{Total Outflow} $
+ equal to $\text{Total Inflow} - \text{Total Outflow}$
+ Cash Flow is often more important than Net Growth, as the Gain/Loss part of Net Growth is usually beyond one's control
+ [Securities](#security-) Gain/Loss
+ [Currencies](#currency-) Gain/Loss
+ Total Gain/Loss
+ Net Growth
+ equal to $ \text{Cash Flow} + \text{Total Gain/Loss}$
+ equal to $\text{Cash Flow} + \text{Total Gain/Loss}$
+ [Savings Rate](#savings-rate)

---
Expand Down Expand Up @@ -255,7 +255,7 @@ In Kapytal, Dialogs are "disposable" user interface elements/windows used for si

Dividend is a sub-type of [Security Transaction](#security-transaction) that represents the gain of money in a [Cash Account](#cash-account-) which is connected to a [Security](#security-) from a [Security Account](#security-account-), but which does not change the amount of shares held in the Security Account. The keyboard shortcut for adding a Dividend is the `Shift+D` key combination, as `D` is reserved for the *Duplicate Transaction* action (as a mnemonic, the `Shift` stands for Security, just like in the [Security Transfer](#security-transfer-) shortcut).

Dividends are included in the Total and Realized performance stats shown in the Overview tab of the [Securities Form](#securities-form).
Dividends are included in the Total and Realized performance shown in the Overview tab of the [Securities Form](#securities-form).

---

Expand All @@ -281,9 +281,9 @@ In Kapytal, Forms are user interface elements/windows used for more complex sett

These are some of the Forms in Kapytal:

+ [Category](#category-) Form
+ [Categories](#category-) Form
+ [Currencies Form](#currencies-form)
+ [Payee](#payee-) Form
+ [Payees](#payee-) Form
+ [Update Quotes Form](#update-quotes-form-)
+ [Securities Form](#securities-form)
+ [Settings Form](#settings-form-)
Expand Down Expand Up @@ -390,14 +390,51 @@ Savings Rate is a quantity evaluated in [Cash Flow Reports](#cash-flow-reports-)

Savings Rate quantifies saved money relative to the sum of all saveable money for a given period. [Refunds](#refund-) contribute towards the saved amount, but not towards the saveable amount, therefore Savings Rate of more than 100% is theoretically possible.

The formula is: $ \text{Savings Rate} = \text{Cash Flow} / (\text{Income} + \text{Inward Transfers}) = (\text{Inflows} - \text{Outflows}) / (\text{Inflows} - \text{Refunds}) $
The formula is: $\text{Savings Rate} = \text{Cash Flow} / (\text{Income} + \text{Inward Transfers}) = (\text{Inflows} - \text{Outflows}) / (\text{Inflows} - \text{Refunds})$

---

### Securities Form

Securities Form is the [Form](#form) for creating, editing, deleting, manipulating and updating [Securities](#securities-form) and their price quotes. In the Overview tab, an overview of Securities and all Security Accounts which contain their shares is available, including a large number of performance related quantities.

Securities Form is the [Form](#form) for creating, editing, deleting, manipulating and updating [Securities](#securities-form) and their price quotes.

In the Overview tab, an overview of Securities and all [Security Accounts](#security-account-) which contain their shares is available, including a large number of performance related quantities.

Some performance quantities are available in the following "flavors":

+ Realized (R)
+ actual performance based on paid-out [Dividends](#dividend-) and completed [Sell](#sell-) [Transactions](#transaction)
+ Unrealized (U)
+ virtual performance which could hypothetically be realized if all owned Security shares were sold for market price
+ Total (T)
+ sum of realized and unrealized performance

Some performance quantities are available in [base](#base-currency) and/or [native](#native-currencyamount) [Currencies](#currency-). This means that the quantities are calculated using base or native $\text{Avg. Buy Price}$ or $\text{Avg. Sell Price}$ respectively. These quantities are different, even after [Exchange Rate](#exchange-rate-) conversion! This is because $\text{Avg. Buy Price}$ and $\text{Avg. Sell Price}$ take the Exchange Rates for the given Transaction [date](#date) into account, and they are therefore affected by the Exchange Rate history. For more details, [see this FAQ question](./faq.md#in-securities-form-overview-tab-tree-why-do-the-quantities-denominated-in-native-and-base-currencies-sometimes-not-match-after-converting-them-with-the-latest-exchange-rate-to-base-currency-why-are-native-and-base-currency-returns-different).

Following performance quantities are available:

+ Gain
+ available in base and native Currencies
+ available in Realized, Unrealized and Total flavors
+ $\text{Realized Gain} = \text{Shares Sold} * (\text{Avg. Sell Price} - \text{Avg. Buy Price}) + \text{Dividends}$
+ $\text{Unrealized Gain} = \text{Shares Owned} * (\text{Market Price} - \text{Avg. Buy Price})$
+ $\text{Total Gain} = \text{Realized Gain} + \text{Unrealized Gain}$
+ Currency Gain
+ available only in base Currency
+ available only in Total flavor
+ $\text{Total Currency Gain} = \text{Total Base Gain} - \text{Total Native Gain}$
+ Return
+ relative return in percent
+ available in base and native Currencies
+ available in Realized, Unrealized and Total flavors
+ $\text{Realized Return} = \frac{\text{Shares Sold} * (\text{Avg. Sell Price} - \text{Avg. Buy Price})}{\text{Shares Sold} * \text{Avg. Buy Price}}+\frac{\text{Dividends}}{\text{Shares Bought} * \text{Avg. Buy Price}}$
+ $\text{Unrealized Return} = \frac{\text{Unrealized Gain}}{\text{Shares Owned} * \text{Avg. Buy Price}}$
+ $\text{Total Return} = \frac{\text{Total Gain}}{\text{Avg. Buy Price} * \text{Shares Bought}}$
+ Annualized [Internal Rate of Return (IRR)](https://en.wikipedia.org/wiki/Internal_rate_of_return)
+ available in base and native Currencies
+ available only in Total flavor
+ calculated using the [`pyxirr`](https://pypi.org/project/pyxirr/) package `xirr` function, which takes the dates of Security Transactions into account

---

### Security ![Icon](../resources/icons/icons-16/certificate.png)
Expand Down
162 changes: 161 additions & 1 deletion docs/screenshots.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,163 @@
# Screenshots

Documentation under construction
### Welcome dialog

![Welcome](../resources/screenshots/welcome_cropped.png)

---

### Main window

![Main Window](../resources/screenshots/main_window_cropped.png)

---

### File menu and Demos

![File menu and Demos](../resources/screenshots/file_menu.png)

---

### Hidden Account Tree and Transaction Table header context menu

![Hidden Account Tree and Transaction Table header context menu](../resources/screenshots/columns_cropped.png)

---

### Cash Transaction dialog

![Cash Transaction dialog](../resources/screenshots/cash_transaction_cropped.png)

---

### Cash Transfer dialog

![Cash Transfer dialog](../resources/screenshots/cash_transfer_cropped.png)

---

### Refund dialog

![Refund dialog](../resources/screenshots/refund_cropped.png)

---

### Security Transaction

![Security Transaction dialog](../resources/screenshots/security_transaction_cropped.png)

---

### Transaction context menu

![Transaction context menu](../resources/screenshots/transaction_context_cropped.png)

---

### Transaction Filters

![Transaction Filters](../resources/screenshots/transaction_filters_cropped.png)

---

### Currencies and Exchange Rates

![Currencies and Exchange Rates](../resources/screenshots/currencies_cropped.png)

---

### Securities management

![Securities management](../resources/screenshots/securities_manage_cropped.png)

---

### Securities overview

![Securities overview](../resources/screenshots/securities_overview_cropped.png)

---

### Update Quotes

![Update Quotes](../resources/screenshots/update_quotes_cropped.png)

---

### Categories

![Categories](../resources/screenshots/categories_cropped.png)

---

### Tags

![Tags](../resources/screenshots/tags_cropped.png)

---

### Payees

![Payees](../resources/screenshots/payees_cropped.png)

---

### Net Worth Accounts Report

![Net Worth Accounts Report](../resources/screenshots/report_accounts_cropped.png)

---

### Net Worth Asset Type Report

![Net Worth Asset Type Report](../resources/screenshots/report_asset_type_cropped.png)

---

### Net Worth Time Report

![Net Worth Time Report](../resources/screenshots/report_time_cropped.png)

---

### Cash Flow Total Report

![Cash Flow Total Report](../resources/screenshots/report_cashflow_total_cropped.png)

---

### Cash Flow Monthly Report

![Cash Flow Monthly Report](../resources/screenshots/report_cashflow_monthly_cropped.png)

---

### Categories Report

![Categories Report](../resources/screenshots/report_category_cropped.png)

---

### Tags Report

![Tags Report](../resources/screenshots/report_tag_cropped.png)

---

### Payees Report

![Payees Report](../resources/screenshots/report_payee_cropped.png)

---

### Settings

![Settings](../resources/screenshots/settings_cropped.png)

---

### About Kapytal

![About](../resources/screenshots/about_cropped.png)

---
46 changes: 23 additions & 23 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,61 +7,61 @@ charset-normalizer==3.3.2
click==8.1.7
colorama==0.4.6
contourpy==1.2.0
coverage==7.4.1
coverage==7.4.4
cycler==0.12.1
fonttools==4.48.1
fonttools==4.50.0
frozendict==2.4.0
gprof2dot==2022.7.29
html5lib==1.1
hypothesis==6.98.3
hypothesis==6.99.13
idna==3.6
iniconfig==2.0.0
kiwisolver==1.4.5
lxml==5.1.0
matplotlib==3.8.2
lxml==5.1.1
matplotlib==3.8.3
multitasking==0.0.11
mypy==1.8.0
mypy==1.9.0
mypy-extensions==1.0.0
numpy==1.26.4
packaging==23.2
packaging==24.0
pandas==1.5.3
pathspec==0.12.1
peewee==3.17.1
pefile==2023.2.7
pillow==10.2.0
pip3-autoremove==1.2.0
pipdeptree==2.13.2
pip3-autoremove==1.2.2
pipdeptree==2.16.2
platformdirs==4.2.0
pluggy==1.4.0
pydantic==1.10.14
pyinstaller==6.3.0
pyinstaller-hooks-contrib==2024.0
pyparsing==3.1.1
pyinstaller==6.5.0
pyinstaller-hooks-contrib==2024.3
pyparsing==3.1.2
PyQt6==6.6.1
PyQt6-Charts==6.6.0
PyQt6-Charts-Qt6==6.6.1
PyQt6-Qt6==6.6.1
PyQt6-Charts-Qt6==6.6.2
PyQt6-Qt6==6.6.2
PyQt6-sip==13.6.0
pytest==8.0.0
pytest-cov==4.1.0
pytest==8.1.1
pytest-cov==5.0.0
pytest-qt==4.4.0
python-dateutil==2.8.2
python-dateutil==2.9.0.post0
pytz==2024.1
pytz-deprecation-shim==0.1.0.post0
pywin32-ctypes==0.2.2
pyxirr==0.10.3
quiffen==2.0.10
requests==2.31.0
ruff==0.2.1
setuptools==69.0.3
ruff==0.3.4
setuptools==69.2.0
six==1.16.0
snakeviz==2.2.0
sortedcontainers==2.4.0
soupsieve==2.5
tornado==6.4
typing_extensions==4.9.0
tzdata==2023.4
typing_extensions==4.10.0
tzdata==2024.1
tzlocal==5.2
urllib3==2.2.0
urllib3==2.2.1
webencodings==0.5.1
yfinance==0.2.36
yfinance==0.2.37
Binary file added resources/icons/icons-custom/certificates.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/screenshots/about_cropped.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/screenshots/cash_transfer_cropped.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/screenshots/categories_cropped.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/screenshots/columns_cropped.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/screenshots/currencies_cropped.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/screenshots/file_menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/screenshots/main_window_cropped.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/screenshots/payees_cropped.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/screenshots/refund_cropped.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/screenshots/report_payee_cropped.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/screenshots/report_tag_cropped.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/screenshots/report_time_cropped.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/screenshots/settings_cropped.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/screenshots/tags_cropped.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/screenshots/update_quotes_cropped.png
Binary file added resources/screenshots/welcome_cropped.png
Loading

0 comments on commit 959124f

Please sign in to comment.