Skip to main content

Python bindings for Echo VR's HTTP API.

Project description

Echo VR API

Python bindings for Echo VR's HTTP API.

Installation

If you haven't already, install Python 3 and Pipenv.

Now, in your project directory, run:

pipenv install echovr_api

Usage Example

from requests.exceptions import ConnectionError
import json
import echovr_api

try:
    game_state = echovr_api.fetch_state()

    print(f"Game status: {game_state.game_status}")
    print(f"Seconds on clock: {game_state.game_clock}")

    if (game_state.blue_team.score > game_state.orange_team.score):
        print("Blue team is winning!")
    elif (game_state.orange_team.score > game_state.blue_team.score):
        print("Orange team is winning!")
    else:
        print("It's tied!")

    print(f"Score: {game_state.blue_team.score} - {game_state.orange_team.score}")

except ConnectionError as e:
    print("Connection refused. Make sure you're running Echo VR with the -http option and that you're in a match.")
except json.decoder.JSONDecodeError as e:
    print("Could not decode response. (Not valid JSON.)")

For full documentation of the available methods and classes, feel free to browse the docstrings in the source code.

Contributing

To get everything you need to start making changes to this package, first install Python 3 and Pipenv, clone this repository, then run:

pipenv install

Try it

To play around with the API, open an instance of Echo VR with the -http flag, then run:

pipenv run python -i ./test.py

Release process

First, update CHANGELOG.md and the version number in setup.py. Commit, tag, and push these changes.

Next, build the package:

pipenv install --dev
pipenv run python setup.py sdist bdist_wheel

Finally, upload the built packages to PyPi. You can do this using twine (pip install twine):

twine upload dist/*

Project details


Download files

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

Source Distribution

echovr_api-0.1.1.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

echovr_api-0.1.1-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file echovr_api-0.1.1.tar.gz.

File metadata

  • Download URL: echovr_api-0.1.1.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for echovr_api-0.1.1.tar.gz
Algorithm Hash digest
SHA256 594921f8b9c64ed5e28d76ef6bfeccd6fa5adfd36f62f8ae8d0662f84207c007
MD5 f54627f2296b1cdf200426f2ef0ac8a6
BLAKE2b-256 03361a596e8904f4eaeaaaccf91b55c4b86595b7a12150dc860d29f8c022d257

See more details on using hashes here.

File details

Details for the file echovr_api-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: echovr_api-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for echovr_api-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6858b3df4c164b8be1824d396560e35e8bfa03f03843b8dcbd5bf187bace1140
MD5 0e74f98ca40561e4ad1d71282b876931
BLAKE2b-256 0b59d89f4bc6ee6bad75f350609cdff939b4a7a6724d3e27eef4686c3a1679e4

See more details on using hashes here.

Supported by

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