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 0.1.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 0.1.0rc1
File Actions
pyportopt-0.1.0rc1-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for pyportopt-0.1.0rc1-py3-none-win_amd64.whl
pyportopt-0.1.0rc1-py3-none-musllinux_1_2_x86_64.whl Python 3 none Linux musl 1.2+ x86-64 Details for pyportopt-0.1.0rc1-py3-none-musllinux_1_2_x86_64.whl
pyportopt-0.1.0rc1-py3-none-musllinux_1_2_aarch64.whl Python 3 none Linux musl 1.2+ ARM64 Details for pyportopt-0.1.0rc1-py3-none-musllinux_1_2_aarch64.whl
pyportopt-0.1.0rc1-py3-none-manylinux_2_25_x86_64.whl Python 3 none Linux glibc 2.25+ x86-64 Details for pyportopt-0.1.0rc1-py3-none-manylinux_2_25_x86_64.whl
pyportopt-0.1.0rc1-py3-none-manylinux_2_25_aarch64.whl Python 3 none Linux glibc 2.25+ ARM64 Details for pyportopt-0.1.0rc1-py3-none-manylinux_2_25_aarch64.whl
pyportopt-0.1.0rc1-py3-none-macosx_11_0_x86_64.whl Python 3 none macOS 11.0+ x86-64 Details for pyportopt-0.1.0rc1-py3-none-macosx_11_0_x86_64.whl
pyportopt-0.1.0rc1-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for pyportopt-0.1.0rc1-py3-none-macosx_11_0_arm64.whl

Total release size: 1.8 MB

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

Download URL pyportopt-0.1.0rc1-py3-none-win_amd64.whl
Size 314.1 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
227331e0d45658ae61bc7493bc966a19a8901216d2215b2e44c6b38822038bd4
BLAKE2b-256 checksum
How to use checksums
20bd6aa7c61d08085e6339ee09aa9ffabe659d09c8fb9d8f36d55affdabf3388
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-0.1.0rc1-py3-none-musllinux_1_2_x86_64.whl

Download URL pyportopt-0.1.0rc1-py3-none-musllinux_1_2_x86_64.whl
Size 359.1 kB
Tags Linux musl 1.2+ x86-64 Python 3
SHA-256 checksum
How to use checksums
448e2c06e8e1a6a1b3c712b0d8eca1ab855e41c062b5138824ecbff6442c30cd
BLAKE2b-256 checksum
How to use checksums
ce61278d3a1076878bc5e089ed3e7cd4cf2f2d18db0e1ab3688ad8a3f48f3fcf
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-0.1.0rc1-py3-none-musllinux_1_2_aarch64.whl

Download URL pyportopt-0.1.0rc1-py3-none-musllinux_1_2_aarch64.whl
Size 331.8 kB
Tags Linux musl 1.2+ ARM64 Python 3
SHA-256 checksum
How to use checksums
e4a2e4bc5314c74d145c281f7b9e5c77435ea38094740a58d467b800dae91019
BLAKE2b-256 checksum
How to use checksums
92438dd6bc410860e17b199f7c927e45517e10f7a31b63557f0aa13c554fb814
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-0.1.0rc1-py3-none-manylinux_2_25_x86_64.whl

Download URL pyportopt-0.1.0rc1-py3-none-manylinux_2_25_x86_64.whl
Size 281.5 kB
Tags Linux glibc 2.25+ x86-64 Python 3
SHA-256 checksum
How to use checksums
29785ada49bb50e5c81bdf7081ffe39bb564f53f71fa351dfbee0613beed03fe
BLAKE2b-256 checksum
How to use checksums
55ed29e5324779b0351843b23c15c8492af2b04821f85fce739dc76d1072bc52
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-0.1.0rc1-py3-none-manylinux_2_25_aarch64.whl

Download URL pyportopt-0.1.0rc1-py3-none-manylinux_2_25_aarch64.whl
Size 254.0 kB
Tags Linux glibc 2.25+ ARM64 Python 3
SHA-256 checksum
How to use checksums
eedd9d813781a5e9ea0eba4941a8329fc8cd62718521bd3f57500a5184420b0f
BLAKE2b-256 checksum
How to use checksums
4cd437798690962bb445b18b0b85a8b210e99b77ba8bcabdc35999cdb05b5168
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-0.1.0rc1-py3-none-macosx_11_0_x86_64.whl

Download URL pyportopt-0.1.0rc1-py3-none-macosx_11_0_x86_64.whl
Size 132.7 kB
Tags Python 3 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
22063c8b9907ae15b13687df0539d32e78123cb37736df7dfb1139ed9295f11a
BLAKE2b-256 checksum
How to use checksums
63855284478d2d2cef93a347be188c2c0bbf55d80a7e46fec1a89a84e17f38f1
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-0.1.0rc1-py3-none-macosx_11_0_arm64.whl

Download URL pyportopt-0.1.0rc1-py3-none-macosx_11_0_arm64.whl
Size 116.0 kB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
a72a1181c47faf760f342e3636a8e5374e58ccf19e48e9c430484b2eda8b99b4
BLAKE2b-256 checksum
How to use checksums
e111338dc1e7b887b72d18401cdb19bf08ea8c837af3e262f59caffac79239cf
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 0.1.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