<commit_before># copyright-evidence-api
A HTTP API to access the data hosted in the Copyright Evidence Wiki.

![TravisCI](https://travis-ci.org/CREAT-e/copyright-evidence-api.svg?branch=master)

## Quick Start

Create a configuration file:

```python
# See cfg/example.cfg for an example.
DEBUG = True
PORT = 3000
DATABASE = "/home/user/db/database.sqlite"
```

Set the environment variable `COPYRIGHT_EVIDENCE_API_CFG` to the path of your configuration file:

```shell
$ export COPYRIGHT_EVIDENCE_API_CFG=/home/user/copyright-evidence-api/cfg/development.cfg
```

Clone the repository:

```shell
$ git clone https://github.com/CREAT-e/copyright-evidence-api
$ cd copyright-evidence-api
```

Install the dependencies:

```shell
pip install -r requirements/development.txt
```

Run the server.

```shell
$ python src/server.py
```

Open <http://localhost:3000>

## API Reference

### /studies GET

Returns a JSON list of studies.

```json
{
  "studies": [
    {
      "abstract": "...", 
      "authentic_link": "http://iisit.org/Vol7/IISITv7p321-328Acilar817.pdf", 
      "citation": "..."
      ...
    }, 
}
```<commit_msg>Remove syntax highlighting from API reference example response.<commit_after># copyright-evidence-api
A HTTP API to access the data hosted in the Copyright Evidence Wiki.

![TravisCI](https://travis-ci.org/CREAT-e/copyright-evidence-api.svg?branch=master)

## Quick Start

Create a configuration file:

```python
# See cfg/example.cfg for an example.
DEBUG = True
PORT = 3000
DATABASE = "/home/user/db/database.sqlite"
```

Set the environment variable `COPYRIGHT_EVIDENCE_API_CFG` to the path of your configuration file:

```shell
$ export COPYRIGHT_EVIDENCE_API_CFG=/home/user/copyright-evidence-api/cfg/development.cfg
```

Clone the repository:

```shell
$ git clone https://github.com/CREAT-e/copyright-evidence-api
$ cd copyright-evidence-api
```

Install the dependencies:

```shell
pip install -r requirements/development.txt
```

Run the server.

```shell
$ python src/server.py
```

Open <http://localhost:3000>

## API Reference

### /studies GET

Returns a JSON list of studies.

```
{
  "studies": [
    {
      "abstract": "...", 
      "authentic_link": "http://iisit.org/Vol7/IISITv7p321-328Acilar817.pdf", 
      "citation": "..."
      ...
    }, 
}
```
{'fraction_non_alphanumeric': 0.1476480836236934, 'fraction_numerical': 0.016550522648083623, 'mean_word_length': 3.8357894736842106, 'pattern_counts': {'":': 8, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2417598', 'n_tokens_mistral': 822, 'n_tokens_neox': 744, 'n_words': 186}