Skip to main content

Portfolio Selection, Optimization, and backtesting library with sentiment analysis and ML features

Project description

by Güney Kıymaç




🌟 Highlights

  • Combine Modern Portfolio Theory (MPT) with machine learning to optimize portfolios.
  • Select the best portfolio from a given market.
  • Auto-generate detailed, shareable HTML reports summarizing portfolio performance.

ℹ️ Overview

NeoPortfolio extends Modern Portfolio Theory (MPT) with NLP and ML features. The package is geared to reduce the friction in portfolio selection and management by maintaining simplicity in its user-facing interface. Optimize a pre-determined portfolio or let the package automatically select the best portfolio; either way, the results are one function call away!

✍️ Authors

Güney Kıymaç

I'm a Finance student and data science enthusiast! I developed NeoPortfolio to demonstrate my expertise through a project with real-world applications, as opposed to pre-designed portfolio projects often found in courses.

🚀 Usage

As mentioned, the package is designed for simple use. Define your investment preferences on class declaration, and make a single function call to get the results.

from NeoPortfolio import nCrOptimize

opt = nCrOptimize(
    market="^GSPC",  # S&P 500
    n=5,  # Number of assets in the portfolio
    target_return=0.1,
    horizon=21,
    lookback=252,
    max_pool_size=100,  # Maximum number of portfolios to consider
    api_key_path="path/to/your/api/key.env",  # NewsAPI key (has free tier)
    api_var_name="YOU_KEY_VAR"
)
opt.optimize_space(bounds=(0.05, 0.7))

⬇️ Installation

NeoPortfolio is available on PyPI, so you can access it with pip. Python 3.12+ is required for NeoPortfolio.

python -m pip install NeoPortfolio

Dependencies are installed during the pip installation process but PyTorch can cause errors depending on your system and environment. If you encounter any issues, please refer to the PyTorch installation guide. You only need the CPU compute platform and torchvision or torchaudio are not required for this package. (The commands copied from the guide will install all 3 packages unless you remove them.)

💭 Feedback and Contributing

Feel free to use the Discussions and Issues tabs for feedback and suggestions. As NeoPortfolio is a small scale project, there aren't guidelines for contributing. Shoot your suggestions and we'll work on them!

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

neoportfolio-1.3.3.tar.gz (60.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

NeoPortfolio-1.3.3-py3-none-any.whl (51.2 kB view details)

Uploaded Python 3

File details

Details for the file neoportfolio-1.3.3.tar.gz.

File metadata

  • Download URL: neoportfolio-1.3.3.tar.gz
  • Upload date:
  • Size: 60.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for neoportfolio-1.3.3.tar.gz
Algorithm Hash digest
SHA256 42cd7d52fca21ef1d1f64ac0bc03be4dc589aead66d59ca64470bb5150a54f40
MD5 768202bb57bbaad772310a206769cd56
BLAKE2b-256 5bc961e28a23fb07b415deac007ab6379bccc0071842356277e2bbeb92ef4af2

See more details on using hashes here.

File details

Details for the file NeoPortfolio-1.3.3-py3-none-any.whl.

File metadata

  • Download URL: NeoPortfolio-1.3.3-py3-none-any.whl
  • Upload date:
  • Size: 51.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for NeoPortfolio-1.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e5eff4c7c95301f148b6ac763e4e3b9d457870fefac6cc57e38fdfe72e3c11c0
MD5 64739fb82c2d191e1606613a1020de90
BLAKE2b-256 b22993ee69cd9d23d4923b40379684db416c5a4293343b4bd07a8e529d28ef84

See more details on using hashes here.

Supported by

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