From a4e3538102e0e980e109c15479d9b0664f23387b Mon Sep 17 00:00:00 2001 From: "Phyks (Lucas Verney)" Date: Wed, 23 Dec 2015 23:58:16 +0100 Subject: [PATCH] Init bottle app --- fetch_references.py | 4 ++-- main.py | 31 +++++++++++++++++++++++++++++++ requirements.txt | 3 +++ 3 files changed, 36 insertions(+), 2 deletions(-) create mode 100755 main.py diff --git a/fetch_references.py b/fetch_references.py index 7f8e11d..01f5641 100755 --- a/fetch_references.py +++ b/fetch_references.py @@ -3,8 +3,8 @@ import os import sys # Local import -from ..reference_fetcher import arxiv -from ..reference_fetcher import bbl +from reference_fetcher import arxiv +from reference_fetcher import bbl if __name__ == "__main__": diff --git a/main.py b/main.py new file mode 100755 index 0000000..b0f557d --- /dev/null +++ b/main.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python3 +from bottle import get, post, run +from bottle.ext import sqlalchemy +from sqlalchemy import create_engine, Column, Integer, Sequence, String +from sqlalchemy.ext.declarative import declarative_base + + +@get("/doi/") +def doi(doi): + """ + GET /doi/ + + {} + """ + # TODO + pass + + +@post("/doi/") +def doi_post(doi): + """ + POST /doi/ + + {} + """ + # TODO + pass + + +if __name__ == "__main__": + run(host='localhost', port=8080, debug=True) diff --git a/requirements.txt b/requirements.txt index 576b504..b066c81 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,4 @@ requests>=2.4.2 +sqlalchemy>=1.0.10 +bottle>=0.12.9 +bottle-sqlalchemy>=0.4.3