Skip to content

mdeboute/pystock

Repository files navigation

pystock

License CI-CD

A tool that helps you better invest in the stock market.

Features

  • Portfolio Management: Create and manage your investment portfolio.
  • Portfolio Optimization: Optimize your portfolio to achieve desired returns with minimal risk.
  • Monte Carlo Simulation: Run simulations to predict future performance of your portfolio.
  • Dashboard: Visualize your portfolio's performance with interactive charts.

Installation

The package is not yet available on PyPI. To install the package, clone the repository and generate a wheel file:

git clone https://github.com/mdeboute/pystock.git
cd pystock
uv sync
uv build

Then, install the wheel file:

pip install dist/pystock-0.1.0-py3-none-any.whl

Usage

  1. Run the Streamlit app:

    streamlit run app/app.py
  2. Navigate through the sidebar to access different features:

    • Dashboard: Upload your portfolio file to view its performance.
    • Monte Carlo Simulation: Run simulations to predict future performance.
    • Portfolio Optimization: Optimize your portfolio to achieve desired returns.

Project Structure

  • app Contains the Streamlit app and views.
  • pystock: Contains the core logic for portfolio management and optimization.
  • tests: Contains unit tests for the project.
  • pyproject.toml: Project configuration and dependencies.

Contributing

Please follow the CONTRIBUTING.md guidelines.

Packaging and tools

uv is used to manage Python version, library dependencies, packaging and publishing.

To install the needed dependencies:

uv sync

If you add or update some dependencies, you must push the uv.lock.

Formatting and linting

Ruff is used to ensure isort and flake8 standards with some linting functionnalities.

You can format using:

ruff format pystock/

For linting, you can check for errors with (adding option --fix will update your files when ruff is able to do so):

ruff check pystock/

Configuration can be found in pyproject.toml.

Code coverage

Code coverage is done with

pytest --cov=.

Building documentation

Documentation can be built using sphinx and by installing required dependencies.

python -m sphinx docs/source docs/build/

License

This project is licensed under the MIT License.

About

A Portfolio Optimization Python Package

Topics

Resources

License

Stars

Watchers

Forks

Languages