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.8.0

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.8.0
File Size Uploaded Provenance Actions
pypsx-2.8.0.tar.gz 41.2 kB Without provenance Details for pypsx-2.8.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for pypsx 2.8.0
File Actions
pypsx-2.8.0-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details for pypsx-2.8.0-cp314-cp314-win_amd64.whl
pypsx-2.8.0-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.8.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
pypsx-2.8.0-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for pypsx-2.8.0-cp313-cp313-win_amd64.whl
pypsx-2.8.0-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.8.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
pypsx-2.8.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for pypsx-2.8.0-cp312-cp312-win_amd64.whl
pypsx-2.8.0-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.8.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
pypsx-2.8.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for pypsx-2.8.0-cp311-cp311-win_amd64.whl
pypsx-2.8.0-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.17+ x86-64, Linux glibc 2.28+ x86-64 Details for pypsx-2.8.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
pypsx-2.8.0-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details for pypsx-2.8.0-cp310-cp310-win_amd64.whl
pypsx-2.8.0-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.17+ x86-64, Linux glibc 2.28+ x86-64 Details for pypsx-2.8.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Total release size: 172.8 MB

Release files / pypsx-2.8.0.tar.gz

Download URL pypsx-2.8.0.tar.gz
Size 41.2 kB
Tags Source
SHA-256 checksum
How to use checksums
6469cec0df7e0bfb9a39b544871b6474aee693d34185f17d8093d5e0a3948823
BLAKE2b-256 checksum
How to use checksums
deb8cb33daa30fc8965d285e08778fb74b4b41966955b0a0a0d3aa29b146c3d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.11.18

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

Download URL pypsx-2.8.0-cp314-cp314-win_amd64.whl
Size 4.4 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
ec5c3e44e208ca9addaa7d9374a41154c9fea276da9ef1239b01de5ee0d003e0
BLAKE2b-256 checksum
How to use checksums
7247e5add865ddbe7884ab13c274ede80a9b217d84a27f6345f4aaef213ebc87
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.11.18

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

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

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

Download URL pypsx-2.8.0-cp313-cp313-win_amd64.whl
Size 4.3 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
c25154dbde4cc9774bdf27fbb1b78fed3a708701a9cdceb2e574885bb03e5a60
BLAKE2b-256 checksum
How to use checksums
2dc34d12e3605a8d49eadeb69e3140f92fee3ac7ab3e63a91984fa7c364fe3e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.11.18

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

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

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

Download URL pypsx-2.8.0-cp312-cp312-win_amd64.whl
Size 4.3 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
a5924da747bcac67c74776a3ff55f66f56fb08ce25868c1160e84edd4c92626a
BLAKE2b-256 checksum
How to use checksums
35e9726a5ff266eea7009d29329e52450915e696121e301727b447315ec0d748
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.11.18

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

Download URL pypsx-2.8.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 31.8 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
3638903464ff15b62893210bc75ffec9f611b66bab1b55b0b2183cf786776c82
BLAKE2b-256 checksum
How to use checksums
0b384ef7eed7d53ce80bc289860642fdfd41de7e1d202c67c024cb398aef5e29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.11.18

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

Download URL pypsx-2.8.0-cp311-cp311-win_amd64.whl
Size 4.4 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
b353bb6b9a85eb4618b6453e7ca813354c4a8ac4475ab44af9436b06439dfacf
BLAKE2b-256 checksum
How to use checksums
9736cadeeac49a471ee3e3d70f3d5fb64fad7de888a13910848a51cc81a87395
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.11.18

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

Download URL pypsx-2.8.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 28.5 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
6ea483407bfb686be5c5568e2361c4abf097a17f4b579b5f806e7c19c8f480d9
BLAKE2b-256 checksum
How to use checksums
8e8de94465ab2da5c74e814a4473a45a20787a60de5eb69771d0137f619526cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.11.18

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

Download URL pypsx-2.8.0-cp310-cp310-win_amd64.whl
Size 4.4 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
9e18310856a1b42f0e9ac28675590402fc3fb3c3bf69e556fea278e10c0baa70
BLAKE2b-256 checksum
How to use checksums
9bfa41fd983bd7793bd5ecc8474c9ff6d18277f030ba20d3a314c371de5ecfab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.11.18

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

Download URL pypsx-2.8.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 27.5 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
0f9ea73477f0ef1adac9e78f23bb074de9e4059d9eda1b24531c7f53f90793e6
BLAKE2b-256 checksum
How to use checksums
47ea5da76847faf80f9049b8baaaf7aca87efe5fea13328009a7303cb816f3f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.11.18

Security for pypsx 2.8.0

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