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

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

Built distributions (wheels)

Table of built distributions (wheels) for pypsx 2.8.3
File Actions
pypsx-2.8.3-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details for pypsx-2.8.3-cp314-cp314-win_amd64.whl
pypsx-2.8.3-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 for pypsx-2.8.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
pypsx-2.8.3-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for pypsx-2.8.3-cp313-cp313-win_amd64.whl
pypsx-2.8.3-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.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
pypsx-2.8.3-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for pypsx-2.8.3-cp312-cp312-win_amd64.whl
pypsx-2.8.3-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.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
pypsx-2.8.3-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for pypsx-2.8.3-cp311-cp311-win_amd64.whl
pypsx-2.8.3-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.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
pypsx-2.8.3-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details for pypsx-2.8.3-cp310-cp310-win_amd64.whl
pypsx-2.8.3-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.8.3-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Total release size: 176.8 MB

Release files / pypsx-2.8.3.tar.gz

Download URL pypsx-2.8.3.tar.gz
Size 41.2 kB
Tags Source
SHA-256 checksum
How to use checksums
93aff2cb13f92e2b156b497c0b3166aa10409db92a22c6f2b978a52953043105
BLAKE2b-256 checksum
How to use checksums
319a8d79392d7f1936c1c07afc45bd473411954fee1fc837fbd80d8992a72b4d
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.3-cp314-cp314-win_amd64.whl

Download URL pypsx-2.8.3-cp314-cp314-win_amd64.whl
Size 4.5 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
c383d6ef44e7717d50ad0c82e92b7e7495a7543a72c57a94e9b399e2fa985491
BLAKE2b-256 checksum
How to use checksums
206ce23e95a32751d240660013afc2c772dd1864187f57aff28420666c24cd7e
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.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL pypsx-2.8.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 32.1 MB
Tags CPython 3.14 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
13fe933fe12ea36dc4647bcdaba23d1182cf20bc3aae2b866c5c9e832fc8de51
BLAKE2b-256 checksum
How to use checksums
0cf795acab7901145a3764cf3ccdf2f5187790df474c3cb5415a7ba70a89a36c
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.3-cp313-cp313-win_amd64.whl

Download URL pypsx-2.8.3-cp313-cp313-win_amd64.whl
Size 4.4 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
6277c1e04e1a3afc36b0aa015f6da0ec1d632c903e02914f45187ef34acd2edc
BLAKE2b-256 checksum
How to use checksums
002670e51ee89be625d2ac4de0894cc07a5ee9f7a9832250c5d10db89f06446e
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.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL pypsx-2.8.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 32.5 MB
Tags CPython 3.13 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
e91812a700869fbc7bba69243fa2009d830127db8e0d9d675cbcd19f98fec9fe
BLAKE2b-256 checksum
How to use checksums
49ff765cff90d3bc71f12c7d649e7eb3efeb4ae383a46128f74e0090ad4f855b
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.3-cp312-cp312-win_amd64.whl

Download URL pypsx-2.8.3-cp312-cp312-win_amd64.whl
Size 4.4 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
3b7e020ac0e4383a94d05ee340b7568227adc17a2f2bf17d3f413353fec03e6b
BLAKE2b-256 checksum
How to use checksums
5b784481d631be56b8154d13218e2d2dee04fdfa6c60973b8faad4494ee7b9ab
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.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL pypsx-2.8.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 32.6 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
e3cca58793c8a318d0ae0141a74e5cfbb058d6457d01f67d84c4929c1d4b57d2
BLAKE2b-256 checksum
How to use checksums
3654ba1a7fb6c68053f39a224619085396b24be30c7a8ed50def7c44bc743d0c
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.3-cp311-cp311-win_amd64.whl

Download URL pypsx-2.8.3-cp311-cp311-win_amd64.whl
Size 4.5 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
8c8052321b2d3cf19204e6796d624da4d6f8f68618d8da2ea2e3315cd9dfccb6
BLAKE2b-256 checksum
How to use checksums
a8023718b00173343bcebee5b7f9b800e828e6fa99e3771d7fe5583d68d15197
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.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL pypsx-2.8.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 29.2 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
8b18516d742bbf21d9ca5f30489bb60ab1e6dd463d3ef0c7b5a38e114e179b94
BLAKE2b-256 checksum
How to use checksums
b9e3568c8ab9890ff63e91c48de93c4ffb1082fa3d34c27bd60927e5f06bded8
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.3-cp310-cp310-win_amd64.whl

Download URL pypsx-2.8.3-cp310-cp310-win_amd64.whl
Size 4.5 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
7eb7d896170f18dc5c8a518c4bb13e1aee9398a3bc93c362ca39f7f9618518d5
BLAKE2b-256 checksum
How to use checksums
6173333d574c86c76f5798d3e0a3680f54fd42abe8fffe23547d2c13431ec663
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.3-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL pypsx-2.8.3-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 28.1 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
d6102720b78d8ee8400937e6445f7889f5adad7b13934a52bbb586d73d8daa09
BLAKE2b-256 checksum
How to use checksums
b23d94639be8c6c0eaacc9522ab47881a9ba76e4ed6826db23c6a1996f03fc18
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.3

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