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
Release history Release notifications | RSS feed
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)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
32533abc370944545f806253a238c1f3a97ab6a94fa24b7b4fa8b9ffb3f1b819
|
|
| MD5 |
fc9f1e7343c8a455f8d8ab632e5fbacf
|
|
| BLAKE2b-256 |
886ac6068a0e3ac0f1281cb3bcbbb366b0f15fd64301f73f483517b455bcc882
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b1090d6d4a4a151281d95aa49dd30bb154884ce3f59d49dd318d91b4bc5e2af
|
|
| MD5 |
4b73b499bf1f4dbc2aa1a9509ff37be1
|
|
| BLAKE2b-256 |
f2ed6565fc38090974ef104d518ee8ca848955b2349e7d275737e008f847ed5e
|