Skip to main content

A collection of portfolio tracking capabilities

Project description


Portfolio

Simple investment portfolio tool that will track stock and provide returns and other metrics. It also contains a web dashboard to view the data.

workflow badge license badge codecov Code style: black Static Badge

Table of Contents

Overview

🚀 Welcome to FolioFlex! 🚀

📖 Description:

  • FolioFlex is your go-to toolkit for portfolio management and market analysis! Dive into the world of stocks, bonds, and more with our user-friendly tools. 📈📊

🔧 Features:

  • Market Screener: Filter and find trending stocks. 🔍 stock
  • Portfolio Management: Organize and track, your investments. 💼 portfolio
  • Budget Tool: Create and monitor a budget. 💰 budget

📚 Documentation:

🎥 See It In Action:

🔬 Jupyter Notebook:

🤝 Contribute:

  • Love FolioFlex? Feel free to contribute and make it even better! Every bit of help is appreciated. ❤️

Data sources:

Inspiration:

Installation

Local Install

To install, this repository can be installed by running the following command in the environment of choice.

pip install folioflex

Other options can be installed if using more functionality

pip install folioflex
pip install folioflex[dev]    # if needing to develop or lint

Or could be done using GitHub.

pip install git+https://github.com/jkoestner/folioflex.git

If wanting to do more and develop on the code, the following command can be run to install the packages in the requirements.txt file.

pip install -e .
pip install -e .[dev]

Docker Install

The package can also be run in docker which provides a containerized environment, and can host the web dashboard.

To run the web dashboard there are a few prerequisites.

  • Docker
  • Redis
  • Worker
  • Flower (optional)

The following can be used in a docker-compose.yml.

version: "3.8"
services:
  folioflex-web:
    image: dmbymdt/folioflex:latest
    container_name: folioflex-web
    command: gunicorn -b 0.0.0.0:8001 folioflex.dashboard.app:server
    restart: unless-stopped
    environment:
      FFX_CONFIG_PATH: /code/folioflex/configs
    ports:
      - '8001:8001'
    volumes:
      - $DOCKERDIR/folioflex-web/configs:/code/folioflex/configs

The docker container has a configuration file that can read in environment variables or could specify within file.

There is also an environment variable that can specify the path to the configuration folder.

ENVIRONMENT VARIABLES
Variable Description Default
FFX_CONFIG_PATH The path to the configuration folder folioflex/folioflex/configs

Usage

CLI

CLI can be used for easier commands of python scripts for both portfolio or manager. An example of a CLI command is shown below.

ffx email --email_list "['yourname@outlook.com']" --heatmap_market {}

Python

When using the portfolio class, the following code can be used to get the returns of a portfolio.

from folioflex.portfolio.portfolio import Portfolio
config_path = "portfolio_demo.yml"
pf = Portfolio(
    config_path=config_path, 
    portfolio='company_a'
)
pf.get_performance()

Web Dashboard - Invest

A demo of the app can be seen at https://invest.koestner.fun/.

It also can be run locally by going to the project root folder and running below. There are a number of environment variables listed in constants to be able to run locally.

python app.py

Plaid Dashboard

A separate dashboard can be run for transaction aggregation. This is a work in progress and will be updated as more functionality is added.

The transactions are sourced from Plaid. To be able to use the dashboard there needs to be three services run:

  • plaid client: this is the frontend
  • plaid server: this is the backend which will query the api as well as interact with the database
  • plaid db: this is holding the data

The Plaid Pattern repository was used as a reference for the docker-compose setup.

  plaid-db:
    container_name: plaid-db
    image: postgres:latest
    restart: unless-stopped
    volumes:
      - $DOCKERDIR/plaid/database/init:/docker-entrypoint-initdb.d
      - $DOCKERDIR/plaid/data:/var/lib/postgresql/data
    ports:
      - $PLAID_DB_PORT:5432
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: $PLAID_POSTGRES

  plaid-server:
    hostname: server
    container_name: plaid-server
    image: docker-plaid-server:latest
    restart: unless-stopped
    # build: $DOCKERDIR/plaid/server
    ports:
      - $PLAID_SERVER_PORT:5001
    environment:
      PLAID_CLIENT_ID: $PLAID_CLIENT_ID
      PLAID_DEVELOPMENT_REDIRECT_URI: $PLAID_DEVELOPMENT_REDIRECT_URI
      PLAID_ENV: $PLAID_ENV
      PLAID_SECRET_DEVELOPMENT: $PLAID_DEV_SECRET
      PLAID_SECRET_SANDBOX: $PLAID_SAND_SECRET
      PLAID_WEBHOOK_URL: $PLAID_WEBHOOK_URL
      PORT: $PLAID_SERVER_PORT
      DB_PORT: $PLAID_DB_PORT
      DB_HOST_NAME: plaid-db
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: $PLAID_POSTGRES
    depends_on:
      - plaid-db
      
  plaid-client:
    container_name: plaid-client
    image: docker-plaid-client:latest
    restart: unless-stopped
    # build: $DOCKERDIR/plaid/client
    ports:
      - $PLAID_PORT:3001
    environment:
      REACT_APP_PLAID_ENV: $PLAID_ENV
      REACT_APP_SERVER: $PLAID_SERVER
      DANGEROUSLY_DISABLE_HOST_CHECK: true
    depends_on:
      - plaid-server

Other Tools

Jupyter Lab Usage

To have conda environments work with Jupyter Notebooks a kernel needs to be defined. This can be done defining a kernel, shown below when in the conda environment.

python -m ipykernel install --user --name=folioflex

Logging

If wanting to get more detail in output of messages the logging can increased

from folioflex.utils import config_helper
config_helper.set_log_level("DEBUG")

Coverage

To see the test coverage the following command is run in the root directory.

pytest --cov=folioflex --cov-report=html

Go to Top

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

folioflex-1.4.0.tar.gz (1.1 MB view details)

Uploaded Source

Built Distribution

folioflex-1.4.0-py3-none-any.whl (1.1 MB view details)

Uploaded Python 3

File details

Details for the file folioflex-1.4.0.tar.gz.

File metadata

  • Download URL: folioflex-1.4.0.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for folioflex-1.4.0.tar.gz
Algorithm Hash digest
SHA256 1857b7701383b3651f09e40303888fc7d8de60edfc4ba903c4f59070d0ac01e5
MD5 b8938e87d6bad597c2e9adbb6b0643d8
BLAKE2b-256 1d3d4e63a5a2416896e69b871675f65ffe139080374b9ec72b955731daca94b0

See more details on using hashes here.

File details

Details for the file folioflex-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: folioflex-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for folioflex-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eb071dba8c81f633522ff0b4c482ae8eeb19d7bc8cb29064181bba4f00cdb3aa
MD5 c995dfb72403cd4bfbb8ee25605534dd
BLAKE2b-256 532f3c45b6683680a0c3d77c26e362d998391106ccd847ce7a65c79ff7e0eec3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page