Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/peterjclaw/srcomp-http

Web API to the state of the Student Robotics Competition
https://github.com/peterjclaw/srcomp-http

srcomp

Last synced: about 1 month ago
JSON representation

Web API to the state of the Student Robotics Competition

Awesome Lists containing this project

README

        

SR Comp HTTP
============

|Build Status| |Docs Status|

A HTTP interface around `SRComp `__,
the fifth round of `Student Robotics `__ competition
software.

This repository provides a JSON API to accessing information about the
state of the competition. It is a lightweight
`Flask `__ application wrapping the
`SRComp `__ python
APIs to the competition state.

Usage
-----

**Install**:

.. code:: shell

pip install sr.comp.http

**Configuration**

In deployment you should configure the app by setting the ``COMPSTATE`` key of
the app's config to the absolute path of the compstate which the server intends
to serve.

.. code:: python

from sr.comp.http import app
app.config['COMPSTATE'] = '/path/to/compstate'

Development
-----------

**Clone**:

For tests to work, you will need to clone the `tests/dummy` submodule too:

``git submodule update --init``

**Install**:

.. code:: shell

pip install -e .

**Run**:
``./run $COMPSTATE``.

**Test**:
``./run-tests``

Developers may wish to use the `SRComp Dev`_ repo to setup a dev instance.

State Caching
~~~~~~~~~~~~~

Since loading a given state repo takes a non-trivial amount of time,
this is cached within the Flask application. Updates to the state repo
are not tracked directly, and must be signalled by running the
``./update`` script provided.

.. |Build Status| image:: https://circleci.com/gh/PeterJCLaw/srcomp-http.svg?style=svg
:target: https://circleci.com/gh/PeterJCLaw/srcomp-http

.. |Docs Status| image:: https://readthedocs.org/projects/srcomp-http/badge/?version=latest
:target: https://srcomp-http.readthedocs.org/

.. _`SRComp Dev`: https://github.com/PeterJCLaw/srcomp-dev