screepsapi
This is an unofficial client for the Screeps Unoffical API.
Since the API is unofficial it could in theory change at any time. In practice though breaking changes are rare.
Setup:
Simply install the library using pip.
Usage
Authentication
To authenticate to the primary servers just supply a username and password.
import screepsapi
USER = "MyUsername"
PASSWORD = "TimeTravelingSecretAgentForHire"
api = screepsapi.API(USER, PASSWORD)
It is also possible to access private servers with the host and secure parameters.
import screepsapi
USER = "MyUsername"
PASSWORD = "TimeTravelingSecretAgentForHire"
api = screepsapi.API(USER, PASSWORD, host="server1.screepspl.us:443", secure=True)
Note that by default private servers do not use SSL and all traffic is unencrypted.
API
The API itself is a simple REST-based API. Each method in the api library corresponds to a different endpoint for the API.
The best way to discover functionality is to read through the library itself.
Console Example
import screepsapi
USER = "MyUsername"
PASSWORD = "TimeTravelingSecretAgentForHire"
api = screepsapi.API(USER, PASSWORD, host="server1.screepspl.us:443", secure=True)
# Run "Game.time" on shard1 via the console
api.console('Game.time', shard='shard1')
User Information Example
import screepsapi
USER = "MyUsername"
PASSWORD = "TimeTravelingSecretAgentForHire"
api = screepsapi.API(USER, PASSWORD, host="server1.screepspl.us:443", secure=True)
# Find the GCL for `tedivm`
user = api.user_find("tedivm")
print user["user"]["gcl"]
Socket
Screeps provides a sizable amount of data over a websocket. This includes console data and room details.
The best way to utilize the socket is to extend screepsapi.Socket and override the various abstract functions.
Metadata
Release files for screepsapi 0.5.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| screepsapi-0.5.1-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Release files / screepsapi-0.5.1-py2.py3-none-any.whl
| Download URL | screepsapi-0.5.1-py2.py3-none-any.whl |
|---|---|
| Size | 7.7 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
df0d08d0dcff18c24a58fae0f03b64aece639f7c26338caf811551a16c55218b
|
|
BLAKE2b-256 checksum How to use checksums |
39bc883fdfb9fb0fc71afebc25cc90e51759e9617c17fb0f2d3c8de9e104da85
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |