Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

pyportopt

Portfolio optimization: minimum variance, maximum return under a volatility cap, maximum Sharpe ratio, mean-variance utility, importance, Kelly, tracking error, maximum diversification and risk parity, with box bounds, a gross exposure limit, cash and the multipliers of every constraint. The numerical core is the PortOpt C++23 library, which this package bundles and calls through its C API.

pip install pyportopt
import numpy as np
import portopt as po

mu = np.array([0.05, 0.08, 0.11])
cov = np.array([[0.04, 0.006, 0.002], [0.006, 0.09, 0.012], [0.002, 0.012, 0.16]])
data = po.Data(mu, cov)
result = po.solve(po.Spec(po.Objective.MIN_VARIANCE, bounds=(0.0, 1.0)), data)
print(result.status.name, result.weights)      # OPTIMAL [0.6234 0.2356 0.141 ] (rounded)

The distribution is pyportopt; the module is portopt. Python 3.11 or newer, with numpy. Until 1.0 the API may change between minor versions. Documentation, the C and C++ interfaces and the changelog: https://github.com/GabrielMarquezMatte/PortfolioOptimization

Metadata

Release files for pyportopt 1.0.0rc1

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

Built distributions (wheels)

Table of built distributions (wheels) for pyportopt 1.0.0rc1
File Actions
pyportopt-1.0.0rc1-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for pyportopt-1.0.0rc1-py3-none-win_amd64.whl
pyportopt-1.0.0rc1-py3-none-musllinux_1_2_x86_64.whl Python 3 none Linux musl 1.2+ x86-64 Details for pyportopt-1.0.0rc1-py3-none-musllinux_1_2_x86_64.whl
pyportopt-1.0.0rc1-py3-none-musllinux_1_2_aarch64.whl Python 3 none Linux musl 1.2+ ARM64 Details for pyportopt-1.0.0rc1-py3-none-musllinux_1_2_aarch64.whl
pyportopt-1.0.0rc1-py3-none-manylinux_2_25_x86_64.whl Python 3 none Linux glibc 2.25+ x86-64 Details for pyportopt-1.0.0rc1-py3-none-manylinux_2_25_x86_64.whl
pyportopt-1.0.0rc1-py3-none-manylinux_2_25_aarch64.whl Python 3 none Linux glibc 2.25+ ARM64 Details for pyportopt-1.0.0rc1-py3-none-manylinux_2_25_aarch64.whl
pyportopt-1.0.0rc1-py3-none-macosx_11_0_x86_64.whl Python 3 none macOS 11.0+ x86-64 Details for pyportopt-1.0.0rc1-py3-none-macosx_11_0_x86_64.whl
pyportopt-1.0.0rc1-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for pyportopt-1.0.0rc1-py3-none-macosx_11_0_arm64.whl

Total release size: 1.9 MB

Release files / pyportopt-1.0.0rc1-py3-none-win_amd64.whl

Download URL pyportopt-1.0.0rc1-py3-none-win_amd64.whl
Size 326.5 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
dd849a8e36e384cecb5856b2c7b45c883001cb2109e092e53fbe84e2990b39cc
BLAKE2b-256 checksum
How to use checksums
227cd0cf5b32a57901824742b6ad595c274bc4bf7e8bb49f0508427a49bd8c51
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / pyportopt-1.0.0rc1-py3-none-musllinux_1_2_x86_64.whl

Download URL pyportopt-1.0.0rc1-py3-none-musllinux_1_2_x86_64.whl
Size 374.5 kB
Tags Linux musl 1.2+ x86-64 Python 3
SHA-256 checksum
How to use checksums
af4faae6da5f19627c40bd5e59b53669924b5ebeb4d376669ae2a2c6f2c79364
BLAKE2b-256 checksum
How to use checksums
bcff3a846e19245f1a7f51ddea4fd737c5a061cb23e06bd2452522581444f57b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / pyportopt-1.0.0rc1-py3-none-musllinux_1_2_aarch64.whl

Download URL pyportopt-1.0.0rc1-py3-none-musllinux_1_2_aarch64.whl
Size 344.9 kB
Tags Linux musl 1.2+ ARM64 Python 3
SHA-256 checksum
How to use checksums
42c16e1b34906f0cc516f3943f8c198b8d806eaae88cc66cb5086366c2428f46
BLAKE2b-256 checksum
How to use checksums
75be1fb5e4242009781e647885fc2e7357b3cd964f77a4e51466172d411429a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / pyportopt-1.0.0rc1-py3-none-manylinux_2_25_x86_64.whl

Download URL pyportopt-1.0.0rc1-py3-none-manylinux_2_25_x86_64.whl
Size 296.3 kB
Tags Linux glibc 2.25+ x86-64 Python 3
SHA-256 checksum
How to use checksums
f11eec4efddc52cc4b59804b63d4b4aa309043e7849121305796c3d0341f137f
BLAKE2b-256 checksum
How to use checksums
c3d15ec710a1579977b573615eb0a4afad134fd0fa41670302f78f9cb5516e7e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / pyportopt-1.0.0rc1-py3-none-manylinux_2_25_aarch64.whl

Download URL pyportopt-1.0.0rc1-py3-none-manylinux_2_25_aarch64.whl
Size 267.2 kB
Tags Linux glibc 2.25+ ARM64 Python 3
SHA-256 checksum
How to use checksums
133f59fa5be46eb638ed3474d5610c4c544e19fc145c21633515b85abd8b3980
BLAKE2b-256 checksum
How to use checksums
d9961a47878ba921501d3af17f0a4b426d1a4977cfbc0ec418909c34c203bb54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / pyportopt-1.0.0rc1-py3-none-macosx_11_0_x86_64.whl

Download URL pyportopt-1.0.0rc1-py3-none-macosx_11_0_x86_64.whl
Size 149.9 kB
Tags Python 3 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
832dabd8b2609851a2ca9a84e6aa01227b06b7a58b3108ac14175bdb16a861a4
BLAKE2b-256 checksum
How to use checksums
ccd44c2b3c72ddca456e45622a99fae45febfc579e5a67b8c7a2cf91bbc4eb58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / pyportopt-1.0.0rc1-py3-none-macosx_11_0_arm64.whl

Download URL pyportopt-1.0.0rc1-py3-none-macosx_11_0_arm64.whl
Size 130.4 kB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
89f2b19540768f0487a4530ae0d7feb3c6aba06f2082bb338ae7d32b47534eb3
BLAKE2b-256 checksum
How to use checksums
4e8dbce4d78b8d969ffadc7b49a24230c1e432f435919cc3dc6f15934e2cd8ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for pyportopt 1.0.0rc1

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