Skip to main content

Spore REST API client

License Python

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)

Source distribution for spore.py 1.1.1
File Size Uploaded
spore.py-1.1.1.tar.gz 8.4 kB Details

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

Release history Release notifications | RSS feed

This release

1.1.1 This release

1 release file

1.1

1 release file

1.0

1 release file

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