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

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.2
File Size Uploaded
pypsx-2.6.2.tar.gz 40.2 kB Details

Built distributions (wheels)

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

Total release size: 157.1 MB

Release files / pypsx-2.6.2.tar.gz

Download URL pypsx-2.6.2.tar.gz
Size 40.2 kB
Tags Source
SHA-256 checksum
How to use checksums
941377b2f343e5636287c59ef12bd83e319f4b4a9a78313b89500611e7038985
BLAKE2b-256 checksum
How to use checksums
6d87292bdd64f2f3a31b294617d71ec6cac8a76fcbeb18d251974ba2c74345a0
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.2-cp314-cp314-win_amd64.whl

Download URL pypsx-2.6.2-cp314-cp314-win_amd64.whl
Size 4.0 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
b3578cbdff7b7cda296478eeed83a3ebc6897e34ce2ca12bc23aa6b4cc4efe0c
BLAKE2b-256 checksum
How to use checksums
8227a4ff9ab532976ef1829ac8f14b37e8aa820ee61ff4a62a9d04c05772fd31
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.2-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL pypsx-2.6.2-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 28.4 MB
Tags CPython 3.14 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
623e236d50266b5ae0ad1883de539d67ab7061703baea175f097e946d758edbf
BLAKE2b-256 checksum
How to use checksums
23479d02b1f01543e8d8769d2ee9b5ee62db85df1b59d7da2a7ef97255f98bec
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.2-cp313-cp313-win_amd64.whl

Download URL pypsx-2.6.2-cp313-cp313-win_amd64.whl
Size 3.9 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
12cc78683700b4f09de448902fb1f7b6d9c7fa043737bb174029734bbc0a3dbb
BLAKE2b-256 checksum
How to use checksums
9765e23791948d394cb3f9c91ecc32a907408759a344997031254f7a7e1fdc34
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.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL pypsx-2.6.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 28.8 MB
Tags CPython 3.13 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
4c500a2c890bd5c5b3429efe6569fbe1f2647d580bce3ac3e449981ba704fdb8
BLAKE2b-256 checksum
How to use checksums
83411bb19debd513a363cef76e0ef17329c29695dc0f62150e0ada7994527b0b
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.2-cp312-cp312-win_amd64.whl

Download URL pypsx-2.6.2-cp312-cp312-win_amd64.whl
Size 3.9 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
f12aca97090d17cb225d9f1c11990930a010c166c7bfbc0813d83e66f9c18ac0
BLAKE2b-256 checksum
How to use checksums
aaa73796d1207562739e9a1f1c4dcef94f4203840db574b7722cd9867e7bc51d
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.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL pypsx-2.6.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 28.9 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
09b17902f600ed055ad100c7e4bdf609bf97169d9f5d0755def899c383dd27e6
BLAKE2b-256 checksum
How to use checksums
f8449e305f87a21e06f1a210dc47f0cf2a562c942cde63c5f7329ac5be1e469f
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.2-cp311-cp311-win_amd64.whl

Download URL pypsx-2.6.2-cp311-cp311-win_amd64.whl
Size 4.0 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
cbf5f630d8b0e32854d8bdd048b60ec7103e91d75a6daf4c7e29a7e439e416b0
BLAKE2b-256 checksum
How to use checksums
76eda13d9525dcfe136729be03b809ec13c5286344d8afa640cd2393d18a5348
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.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL pypsx-2.6.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 25.9 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
d983e9d398ec2d2bd8a5cee5728bcbe0c2efbb9d765e22c068a0819334f0ac47
BLAKE2b-256 checksum
How to use checksums
edb8263cc9b0b832bbe6df901aaa053db346ee09f5143dff75253ab1a4799cc8
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.2-cp310-cp310-win_amd64.whl

Download URL pypsx-2.6.2-cp310-cp310-win_amd64.whl
Size 4.0 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
a06a6306e2d3626fb134bd3d319d6588de4752d3d0554f3a344e5372a0f9c56a
BLAKE2b-256 checksum
How to use checksums
873772d2cfeb97ceb8d45a450582e6f7d58aa4f0c36f596f2a43eb0385f1acaf
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.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

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

Release history Release notifications | RSS feed

2.6.3

11 release files

This release

2.6.2 This release

11 release files

2.6.1

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