Spore REST API client
How to use
> spore_cli.exe --help
Usage: spore_cli [OPTIONS] COMMAND [ARGS]...
CLI for Spore REST API
Options:
--help Show this message and exit.
Commands:
get-asset-comments Get comments of the asset
get-asset-info Get asset information
get-creature Get creature
get-sporecast-assets Get assets of the sporecast
get-stats Get stats
get-user-achievements Get achievements of the user
get-user-assets Get creature of the user
get-user-buddies Get buddies of the user
get-user-info Get user information
get-user-sporecasts Get sporecasts of the user
get-user-subscribers Get subscribers of the user
search-assets Search assets
> spore_cli.exe search-assets --help
Usage: spore_cli search-assets [OPTIONS] {top_rated|top_rated_new|newest|featu
red|maxis_made|random|cute_and_creepy}
[START_INDEX] [LENGTH]
[[building|creature|vehicle|adventure|ufo]]
Search assets
Options:
--help Show this message and exit.
> spore_cli.exe get-creature 500267423060 # Get json info of creature
{"asset_id": 500267423060, "cost": 4065, "health": 3.0, "height": 1.3428643, "meanness": 9.0, "cuteness": 71.26385, "sense": 1.0, "bonecount": 44.0, "footcount": 4.0, "graspercount": 0.0, "basegear": 0.0, "carnivore": 1.0, "herbivore": 0.0, "glide": 0.0, "sprint": 2.0, "stealth": 2.0, "bite": 3.0, "charge": 2.0, "strike": 4.0, "spit": 0.0, "sing": 1.0, "dance": 2.0, "gesture": 5.0, "posture": 0.0}
Build
Build binary:
pyinstaller pyinstaller.spec \
--distpath pyinstaller_builds/dist \
--workpath pyinstaller_builds/build
Build for python (requires Python 3.7+)
pip install --editable .
Work in Python
Install
pip install git+https://github.com/LEv145/spore.py
Or from pypi
pip install spore.py
Simple examples
import asyncio
from spore_api import SporeClient
async def main() -> None:
async with SporeClient() as client:
print(await client.get_creature(500267423060))
asyncio.run(main())
In sync code:
import asyncio
from spore_api import SporeClient
async def client_logic() -> str:
async with SporeClient() as client:
result = await client.get_creature(500267423060)
return result.to_json()
def main() -> None:
loop = asyncio.get_event_loop()
result = loop.run_until_complete(client_logic())
print(f"Json result: {result!r}")
main()
Client methods
get_stats() -> Stats
get_creature(asset_id: int | str) -> Creature
get_user_info(username: str) -> User
get_user_assets(username: str, start_index: int | str, length: int | str) -> Assets
get_user_sporecasts(username: str) -> Sporecasts:
get_sporecast_assets(sporecast_id: int | str, start_index: int | str, length: int | str) -> SporecastAssets
get_user_achievements(username: str, start_index: int | str, length: int | str) -> Achievements
get_asset_info(asset_id: int | str) -> FullAsset
get_asset_comments(asset_id: int | str, start_index: int | str, length: int | str) -> AssetComments
get_user_buddies(username: str, start_index: int | str, length: int | str) -> Buddies
get_user_subscribers(username: str, start_index: int | str, length: int | str) -> Buddies
assets_search(view_type: ViewType, start_index: int | str, length: int | str, asset_type: AssetType | None = None) -> Assets
TODO:
- Tests
- IMPLEMENTATION.md
Metadata
Release files for spore.py 1.1.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 | Actions |
|---|---|---|---|---|
| spore.py-1.1.1.tar.gz | 8.4 kB | Without provenance | Details for spore.py-1.1.1.tar.gz |
Release files / spore.py-1.1.1.tar.gz
| Download URL | spore.py-1.1.1.tar.gz |
|---|---|
| Size | 8.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
59134e72e8054fe4aa4164cdc84a8e2ab25c8da5645a609558d40dfcd4da3cdb
|
|
BLAKE2b-256 checksum How to use checksums |
6264d56828e15b125404ed837169f0c8386cac77e1228b3106fa5bb8c7544539
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.5
|
Security for spore.py 1.1.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.