Skip to main content

pypsx

Programmatic, API-first access to the Pakistan Stock Exchange (PSX). The official Python SDK for pyPSX.

pyPSX is the trading platform for PSX, and it is API-first: everything is available programmatically over a REST and WebSocket API, through this Python SDK, and in a point-and-click web terminal. This is not just a library. The platform gives you free market data, backtesting on 10+ years of history, a paper-trading sandbox, live real-money trading, a live market feed, and an AI Strategy Copilot. This package is the authenticated Python SDK that ties into all of it.

What this package does

pypsx is the authenticated Trading SDK. With one free API key it gives you:

  • Historical and intraday PSX market data.
  • Backtesting on 10+ years of history, with realistic commission and slippage.
  • A free paper-trading sandbox with a real fill engine and FIFO lot accounting.
  • Live real-money trading on your own account after standard KYC onboarding.
  • A live market feed over WebSocket.
  • Strategy Copilot configs that turn plain English into a runnable bot.

The same capabilities are available over REST and WebSocket, and inside the pyPSX web terminal, so you can work in code or point-and-click, whichever fits.

Install

pip install pypsx          # add [jupyter] for Colab and notebooks

Get a free key from the dashboard at https://markets.pypsx.com (keys start with PK_), then:

import pypsx

df = pypsx.download("OGDC", period="10y")                 # 10 years of daily bars
result = pypsx.backtest("rsi_momentum", ["OGDC"], start="2016-01-01", end="2026-01-01")

client = pypsx.TradingClient.from_env(paper=True)         # free paper sandbox
client.place_order(symbol="OGDC", side="BUY", quantity=100, order_type="MARKET")

About pyPSX

pyPSX is the developer platform and company for the Pakistan Stock Exchange. It is distinct from the PSX exchange itself. Building investing into your own product? See the Broker API at https://pypsx.com/broker.

Proprietary license. Full documentation at https://docs.pypsx.com.

Metadata

Release files for pypsx 2.6.4

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

Source distribution (sdist)

Source distribution for pypsx 2.6.4
File Size Uploaded Provenance Actions
pypsx-2.6.4.tar.gz 40.3 kB Without provenance Details for pypsx-2.6.4.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for pypsx 2.6.4
File Actions
pypsx-2.6.4-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details for pypsx-2.6.4-cp314-cp314-win_amd64.whl
pypsx-2.6.4-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 Details for pypsx-2.6.4-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
pypsx-2.6.4-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for pypsx-2.6.4-cp313-cp313-win_amd64.whl
pypsx-2.6.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 Details for pypsx-2.6.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
pypsx-2.6.4-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for pypsx-2.6.4-cp312-cp312-win_amd64.whl
pypsx-2.6.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 Details for pypsx-2.6.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
pypsx-2.6.4-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for pypsx-2.6.4-cp311-cp311-win_amd64.whl
pypsx-2.6.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64, Linux glibc 2.17+ x86-64 Details for pypsx-2.6.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
pypsx-2.6.4-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details for pypsx-2.6.4-cp310-cp310-win_amd64.whl
pypsx-2.6.4-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64, Linux glibc 2.17+ x86-64 Details for pypsx-2.6.4-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Total release size: 157.9 MB

Release files / pypsx-2.6.4.tar.gz

Download URL pypsx-2.6.4.tar.gz
Size 40.3 kB
Tags Source
SHA-256 checksum
How to use checksums
212b2e5029620ee4453b53596b627520100a797e37efc3a6972d0a547e834ee9
BLAKE2b-256 checksum
How to use checksums
0d48bc06c315f78ca1f4ed4a212cad3cc96f21192ef3a54b7a33cad0683819fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.11.17

Release files / pypsx-2.6.4-cp314-cp314-win_amd64.whl

Download URL pypsx-2.6.4-cp314-cp314-win_amd64.whl
Size 4.0 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
21a87fb669f6baaceced7480fc2c50ac437f5a92a6aaedff117c98b26cc26a04
BLAKE2b-256 checksum
How to use checksums
ed9bd1aca9bcb6361d76c3b5e8a375e2c6cced26ff20adbca2334703e0ed86ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.11.17

Release files / pypsx-2.6.4-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL pypsx-2.6.4-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 28.6 MB
Tags CPython 3.14 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
b1d53d8dca34d12f52529f5a7b266ad866cdd12461c5fab3ad7fa90ea343e16c
BLAKE2b-256 checksum
How to use checksums
fa94818c716b6251fd6b17c16c3d7bb17a04da9603da9ede3fda6f4d1ee985fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.11.17

Release files / pypsx-2.6.4-cp313-cp313-win_amd64.whl

Download URL pypsx-2.6.4-cp313-cp313-win_amd64.whl
Size 3.9 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
359391f04c67e10d7a700506b99781bf01a33e60810a85ecc5affac5dc8e2d52
BLAKE2b-256 checksum
How to use checksums
476ad170ffbcec473d000da8a4c8fb1dc84530aa4105e0d2d01fed1f6c8d20e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.11.17

Release files / pypsx-2.6.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL pypsx-2.6.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 29.0 MB
Tags CPython 3.13 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
208df4706328eedb3daed3e77e1da47ff7e163d406ff3fad6bf609aac295a6df
BLAKE2b-256 checksum
How to use checksums
df46d2856e5eb8c51e7f811706a19ac6ac3077d9e4b31c74a2fff196b665c492
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.11.17

Release files / pypsx-2.6.4-cp312-cp312-win_amd64.whl

Download URL pypsx-2.6.4-cp312-cp312-win_amd64.whl
Size 4.0 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
0da5ca02fb6222fc18a50c59c9e1a6f84aa7b9d8fab3db6a7c01bb08d95be7eb
BLAKE2b-256 checksum
How to use checksums
6f1a66aaeda100fe562fd42b90076f21ad8dc42bd18ae5a9575ae7632a6ebadf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.11.17

Release files / pypsx-2.6.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL pypsx-2.6.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 29.0 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
8dac412c703ff354d3bdab45f32fb6a3800b865e3c0852c0e451aa6aa131314b
BLAKE2b-256 checksum
How to use checksums
6a86a6abc4b1ee7574fdcaaaa3166b941d8ee3ac792d470a5e52c3ad1fca0b52
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.11.17

Release files / pypsx-2.6.4-cp311-cp311-win_amd64.whl

Download URL pypsx-2.6.4-cp311-cp311-win_amd64.whl
Size 4.0 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
db5433ceb1c54cff21845f4c27f23cfd27b768ef5eacd8350a4f7479559c70d4
BLAKE2b-256 checksum
How to use checksums
6fd163507de3856f28a18cf0f2e6f86f54b6738c10612c1b5ac08385a53cabd1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.11.17

Release files / pypsx-2.6.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL pypsx-2.6.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 26.1 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
310d5136824e8935af1e11db6131b6cc6a2ae70d01c60c177945f0e7597b9043
BLAKE2b-256 checksum
How to use checksums
174c4b28f6ac0b0a1aab386a950afda38629cdb7e7d3f0a330793f1e28ce32b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.11.17

Release files / pypsx-2.6.4-cp310-cp310-win_amd64.whl

Download URL pypsx-2.6.4-cp310-cp310-win_amd64.whl
Size 4.1 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
fd300ff42d3df9742e0b5e37276f001a3a2e6c97c2acd98d73be228959bad683
BLAKE2b-256 checksum
How to use checksums
5bd1c915a0d830173e5f083cc0cee45db96d3cdd1e9bc0734abb707c5570086b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.11.17

Release files / pypsx-2.6.4-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL pypsx-2.6.4-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 25.2 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
cfc5aa72a43f821b0eb234f6b52be620a60ac3355a99b626cc4eb9f5e35799c9
BLAKE2b-256 checksum
How to use checksums
628ba203bc823a82770e225d0ca0649b58b10c4507e184d00d173e3a8ba2276d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.11.17

Security for pypsx 2.6.4

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