Skip to main content

Python SDK for the PentPort API

Project description

PentPort Python SDK

Python SDK for the PentPort API.

Install

pip install pentport

Authentication

Set your API key in PowerShell:

$env:PENTPORT_API_KEY = "pp_live_REPLACE_ME"

Or pass it directly in Python:

from pentport import PentPort

pp = PentPort(api_key="pp_live_REPLACE_ME")

Quickstart

from pentport import PentPort

pp = PentPort()

account = pp.choose_account("stocks")
account_hash = account["account_hash"]

print(pp.account_balance(account_hash=account_hash))
print(pp.quotes(["AAPL", "TSLA"], account_hash=account_hash))

order = pp.buy("AAPL", 1, account_hash=account_hash)
print(order)

Important

Do not expose your API key in public frontend JavaScript. Use this SDK from a backend, script, notebook, or private automation environment.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pentport-0.1.0.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pentport-0.1.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file pentport-0.1.0.tar.gz.

File metadata

  • Download URL: pentport-0.1.0.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for pentport-0.1.0.tar.gz
Algorithm Hash digest
SHA256 32533abc370944545f806253a238c1f3a97ab6a94fa24b7b4fa8b9ffb3f1b819
MD5 fc9f1e7343c8a455f8d8ab632e5fbacf
BLAKE2b-256 886ac6068a0e3ac0f1281cb3bcbbb366b0f15fd64301f73f483517b455bcc882

See more details on using hashes here.

File details

Details for the file pentport-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pentport-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for pentport-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5b1090d6d4a4a151281d95aa49dd30bb154884ce3f59d49dd318d91b4bc5e2af
MD5 4b73b499bf1f4dbc2aa1a9509ff37be1
BLAKE2b-256 f2ed6565fc38090974ef104d518ee8ca848955b2349e7d275737e008f847ed5e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page