Skip to content

Commit

Permalink
Merge pull request #14 from viventriglia/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
viventriglia authored Jul 17, 2023
2 parents 70d1177 + 89ea0f9 commit 9c0c856
Show file tree
Hide file tree
Showing 19 changed files with 1,803 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
README.md
LICENSE
Dockerfile
11 changes: 4 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ ipython_config.py
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock
poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
Expand Down Expand Up @@ -152,9 +152,6 @@ dmypy.json
# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
*.xlsx
!demo.xlsx
!template.xlsx
7 changes: 7 additions & 0 deletions .streamlit/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[theme]
base="dark"
primaryColor="#B22222"
font="sans serif"

[browser]
gatherUsageStats = false
26 changes: 26 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"editor.detectIndentation": true,
"editor.insertSpaces": true,
"editor.formatOnSave": true,
"indentRainbow.ignoreErrorLanguages": [
"markdown",
],
"autoDocstring.docstringFormat": "numpy",
"autoDocstring.quoteStyle": "\"\"\"",
"autoDocstring.startOnNewLine": true,
"python.defaultInterpreterPath": "${workspaceFolder}/.venv",
"python.linting.mypyEnabled": true,
"python.linting.mypyPath": "${workspaceFolder}/.venv/bin/mypy",
"python.linting.mypyArgs": [
"--ignore-missing-imports",
"--follow-imports=silent",
"--show-column-numbers",
"--disallow-untyped-defs",
"--disallow-untyped-calls"
],
"python.formatting.provider": "black",
"python.formatting.blackPath": "${workspaceFolder}/.venv/bin/black",
"python.linting.enabled": true,
"workbench.colorTheme": "Night Owl",
"window.zoomLevel": 1,
}
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM python:3.10-slim

WORKDIR /app

COPY . .

RUN pip3 install poetry==v1.5.1

RUN poetry install --no-root

EXPOSE 8501

ENTRYPOINT ["poetry", "run", "streamlit", "run", "./src/0_🏠_Home.py", "--server.port=8501", "--server.address=0.0.0.0"]
55 changes: 55 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,56 @@
# Personal Finance for Newbies (PFN)

## What is that?
A web app that, from a file of (buy/sell) financial asset transactions, produces near real-time statistics (updated to the last closing) on your investment portfolio

## How can I run it?

### Streamlit
Install dependencies via poetry

- `poetry install`

Launch the app

- `streamlit run 0_🏠_Home.py`

### Docker
To build the app's docker image

- `docker build -t personal-finance-for-newbies .`

To run the docker image and expose it on a preferred port (for example 8080)

- `docker run -p 8080:8501 personal-finance-for-newbies`

To run the docker image using the host's network (which will make the app accessible on port 8501)

- `docker run --network host personal-finance-for-newbies`

## How can I use my own data?
To load and use your data, download and fill in the template with your accumulation plan's buy/sell transactions and upload it.
Make sure you fill it in correctly. The fields to be entered are:

- **Exchange**: name of the market (according to Yahoo Finance) [list of exchange suffixes](https://help.yahoo.com/kb/SLN2310.html);
- **Ticker**: symbol to identify a publicly traded security;
- **Transaction Date**: date of transaction in DD/MM/YYYY format;
- **Shares**: number of purchased/sold shares; please, include a minus sign to indicate selling;
- **Price**: price of a single share;
- **Fees**: transaction fees, if any.

## How can I help?

### To-Do list
We always look for pull requests, if you know better!
Here's an hopefully up-to-date list of things to build:
- Correlation map between assets
- Improve Sharpe Ratio calculation, to take into account a time-varying:
- risk-free rate
- asset allocation
- Rolling Sharpe ratio chart
- Max Drawdown evaluation
- Sortino and Calmar ratios
- Time slicing (1yr, 3yrs, 5yrs, ..., All) as a global filter
- Docker compose, with these services:
- `jupyter notebook` for prototyping
- `streamlit` to launch the web-app
Binary file added data/in/demo.xlsx
Binary file not shown.
Binary file added data/in/template.xlsx
Binary file not shown.
Binary file added images/favicon.ico
Binary file not shown.
Loading

0 comments on commit 9c0c856

Please sign in to comment.