This is the API server for Statik. It's designed to be the public-facing stats querying server, plus a form of API documentation.
This server is live at api.statik.io.
To use this, you'll need the following.
- Python 3.4 or later
- The following Python libraries
- bottle
- mako
- pymongo
- pyyaml
- To run the development server, you'll need one of the supported Bottle backends. We suggest CherryPy.
- Install Python 3.4 or later if you haven't already
- Install the required libraries - You can do this quickly using
pip install -r requirements.txt - Enter the
config/folder- Copy
config.yml.exampletoconfig.ymland fill it out. - Copy
database.yml.exampletodatabase.ymland fill it out. - You can also do
development.yml.exampleif you need to change the defaults for local testing.
- Copy
- Launch the server
- For testing, you can simply run
python run.pyorpython3 run.py. - For production, you should really use uWSGI.
- For testing, you can simply run
If you're going to work on this or are considering submitting a pull request, please take note of the following guidelines.
- This project fully adheres to PEP8. Go read it.
- Our code is tested using the Flake8 tool. If your code doesn't adhere to PEP8, it will fail the tests.
- The following exceptions are allowed:
- Anything about maximum complexity
- F841: Local variables assigned but never used
- T000: TODO notes
- F403:
from module import * - E265: Block comment not starting with
#(Note the space)
- If you're creating an API route, you must provide the route itself and a description
to the manager's
add_api_routemethod.