Skip to main content

Screeps Unofficial Client for the Unofficial API

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

screepsapi-0.4.1-py2.py3-none-any.whl (7.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file screepsapi-0.4.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for screepsapi-0.4.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b6b1cc35ea6b17e34c73241ffa92a877d3fab50c2dc26d2e804b1f72f39efef5
MD5 35216a6f91ffa0165673bcc01aaa7003
BLAKE2b-256 2d0daae9db9ffe11299bc7b6ca784a86441b8dfbcddafab012a0786c5c1b2ea8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page