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.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.6.0
File Size Uploaded
pypsx-2.6.0.tar.gz 40.3 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for pypsx 2.6.0
File
pypsx-2.6.0-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details
pypsx-2.6.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
pypsx-2.6.0-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
pypsx-2.6.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.28+ x86-64, Linux glibc 2.17+ x86-64 Details
pypsx-2.6.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
pypsx-2.6.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
pypsx-2.6.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
pypsx-2.6.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
pypsx-2.6.0-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
pypsx-2.6.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

Total release size: 154.0 MB

Release files / pypsx-2.6.0.tar.gz

Download URL pypsx-2.6.0.tar.gz
Size 40.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f49a2bbf296f207d9bf6035b36767cd1f26cdfe1f5429576909541a63445a160
BLAKE2b-256 checksum
How to use checksums
18698289f9264d1c686fa67fe888f52341a20422dbc63bfc02a6073d2ae8b02e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.11.16

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

Download URL pypsx-2.6.0-cp314-cp314-win_amd64.whl
Size 3.9 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
3a5d19ddad9fcd79339a7c76f647512283e3a76481c46ac51af96f50b5e41ecf
BLAKE2b-256 checksum
How to use checksums
639c63bec2ed6c04da82f07d215dc68ce6bc6449c7784964b12b1b65c043bd2a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.11.16

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

Download URL pypsx-2.6.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 27.8 MB
Tags CPython 3.14 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
2f8b3ec7480be2a22da34ae4fddf6f1d5863f95b2d342cd695f1341198319c56
BLAKE2b-256 checksum
How to use checksums
451512782d5e499d5894d642d8075ab04dc664b542cb7186c637d021e4505a5e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.11.16

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

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

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

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

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

Download URL pypsx-2.6.0-cp312-cp312-win_amd64.whl
Size 3.9 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
055e0dd942e978278e302ae27865910fc13f0028f68a3a17a74f84edf2ca067a
BLAKE2b-256 checksum
How to use checksums
5159a6ac1cb478bd9a831a24129000a74feaf0ed48320004872b4af3524bcf62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.11.16

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

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

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

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

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

Download URL pypsx-2.6.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 25.4 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
cc088232f18d742dbdf23d20949d3135ea7253e30804d188df111466203aa11a
BLAKE2b-256 checksum
How to use checksums
4dbcb83cbd99bf33edc620f1be0e0861ca5fb93036b3d7d4ce8bb16ae57ac99d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.11.16

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

Download URL pypsx-2.6.0-cp310-cp310-win_amd64.whl
Size 4.0 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
94d4a34281103f5056fb8ef2b804a53a14afb58d53097adbcae55d0d75e790b8
BLAKE2b-256 checksum
How to use checksums
ab1246b3065be04286d8ad4363c5e5c786140ae22b5e3397b1c915a74c58222a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.11.16

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

Download URL pypsx-2.6.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 24.6 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
85dc6cb303bbd3424c96cf9b541fef2de141de7b46d8a88c10423939f27b3879
BLAKE2b-256 checksum
How to use checksums
0fd3a2ea94c5a0af42a1a1410ecc957ef91438f71b86da3453117d3477578fb3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.11.16

Release history Release notifications | RSS feed

2.6.3

11 release files

2.6.2

11 release files

2.6.1

11 release files

This release

2.6.0 This release

11 release files

2.4.1

10 release files

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