ksp.py
An API wrapper for KSP.
The documentation is not done yet.
Features
- Fetch full product data easily (includes stock, tags, price, etc)
- Look for queries easily. (MORE COMING SOON)
Installation
Installing ksp.py is very easy.
python -m pip install ksp.py
Examples
Simple product stock viewer.
import time
import ksp
client = ksp.Client(ksp.Languages.ENGLISH)
cache = []
while True:
product = client.get_product(...)
if product and product.stock:
available_branches = [
branch for branch, status in product.stock.items() if status
]
for branch in available_branches:
if branch not in cache:
print(f"Branch '{branch}' has been resupplied!")
for branch in cache:
if branch not in available_branches:
print(f"Branch '{branch}' ran out of stock!")
cache = available_branches
time.sleep(2)
TODO
- Add async support.
Known Issues
- Currently, None!
Incase you do find bugs, please create an issue or a PR.
Support
Metadata
Release files for ksp.py 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| ksp.py-0.0.1.tar.gz | 8.1 kB | Without provenance | Details |
Release files / ksp.py-0.0.1.tar.gz
| Download URL | ksp.py-0.0.1.tar.gz |
|---|---|
| Size | 8.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
98bb600faebb91c0c591536448f7deb07299aba32bf0e7450e42679233147fd7
|
|
BLAKE2b-256 checksum How to use checksums |
001ff265fdb344466c4b4ce1ad8bec3cc97655704e75fe3358d448d59649a7a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.6
|
Security for ksp.py 0.0.1
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.