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: 9 months ago
JSON representation
Web API to the state of the Student Robotics Competition
- Host: GitHub
- URL: https://github.com/peterjclaw/srcomp-http
- Owner: PeterJCLaw
- License: gpl-3.0
- Created: 2014-03-14T19:05:42.000Z (over 12 years ago)
- Default Branch: main
- Last Pushed: 2025-04-10T21:36:43.000Z (about 1 year ago)
- Last Synced: 2025-08-20T06:48:23.680Z (10 months ago)
- Topics: srcomp
- Language: Python
- Homepage: https://github.com/PeterJCLaw/srcomp/wiki
- Size: 319 KB
- Stars: 0
- Watchers: 3
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
- Authors: AUTHORS.rst
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