Skip to main content

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.

uv pip install folioflex

Other options can be installed if using more functionality

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

Or could be done using GitHub.

uv 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.

uv sync
uv sync --extra 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 -m folioflex.dashboard.app

Plaid Dashboard

A separate dashboard can be run for transaction aggregation.

The transactions are sourced from Plaid. To be able to use the dashboard there needs to be one other service:

  • folioflex db: this is holding the data

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

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

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

Metadata

Release files for folioflex 1.5.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for folioflex 1.5.2
File Size Uploaded Provenance Actions
folioflex-1.5.2.tar.gz 1.1 MB Without provenance Details for folioflex-1.5.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for folioflex 1.5.2
File Interpreter ABI Platform Actions
folioflex-1.5.2-py3-none-any.whl Python 3 none any Details for folioflex-1.5.2-py3-none-any.whl

Total release size: 2.2 MB

Release files / folioflex-1.5.2.tar.gz

Download URL folioflex-1.5.2.tar.gz
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
1dc492f6093961d8b3dada6de6670e48f6507e8294fa363613c4c80b39b2bf38
BLAKE2b-256 checksum
How to use checksums
b50f0d943a11c2b361b24a5b14739bf2fbe8ef8f84b5ee816372cf95d575c58a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / folioflex-1.5.2-py3-none-any.whl

Download URL folioflex-1.5.2-py3-none-any.whl
Size 1.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
86ad7aed3cecc2a58976c014e1992e37e0fa2adaf9d5c843a3ef972b8b615111
BLAKE2b-256 checksum
How to use checksums
f34fc21ab9ef7f8093587705aeaab6f9939d95207dccd053030bba64722380b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Security for folioflex 1.5.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page