A RESTful reputation server.
This server can be used to collect and retrieve reputation data for any number of users or "reputees."
I am most comfortable using the Anaconda Python distribution, which is nicely cross-platform and has a great package installation experience and almost everything I’ve needed to date.
- Download and follow installation instructions for miniconda from www.anaconda.com
- From a terminal, make an environment named “xeval” for the project:
$ conda create -n xeval python=3.6
- Activate the environment and install packages we’ll need:
$ source activate xeval
(xeval) $ conda install -c conda-forge falcon
(xeval) $ conda install numpy requests jsonschema pytest
- Clone this repository and run setup.py from xeval environment:
(xeval) $ python setup.py install
An entry point is specified during installation. From the command line, simply run
$ reptorServer
There are two optional parameters for specifying IP address and port. These parameters default to
localhost:8000. For help, just use -h
when running.
The web application runs, by default at http://localhost:8000/reptor
POSTs are used to add data to the database. POSTs should JSON formatted with the following schema. If successful, a 402 request is returned.
{
"properties": {
"reputer": {"type": "string"},
"reputee": {"type": "string"},
"repute": {
"type": "object",
"properties": {
"rid": {"type": "string"},
"feature": {"enum": ["clarity", "reach"]},
"value": {
"type": "number",
"minimum": 0.0,
"maximum": 10.0
}
}
}
}
}
HTTP GET is used to request data about a reputee. The body of a GET request should be formatted according to the following schema:
{
"properties": {
"reputee": {"type": "string"}
}
}
This will return a JSON body with the following data format:
{
"properties": {
"clarity": {
"score": {
"type": "number",
"minimum": 0.0,
"maximum": 10.0
},
"confidence": {
"type": "number",
"minimum": 0.0,
"maximum": 1.0
}
},
"reach": {
"score": {
"type": "number",
"minimum": 0.0,
"maximum": 10.0
},
"confidence": {
"type": "number",
"minimum": 0.0,
"maximum": 1.0
}
},
"clout": {
"score": {
"type": "number",
"minimum": 0.0,
"maximum": 1.0
},
"confidence": {
"type": "number",
"minimum": 0.0,
"maximum": 1.0
}
}
}
}
There is a pytest module for development. To use, run $/testing/python test.py