From 355e4203f8a4b406e00d8b2fc40c2af58a7bb71d Mon Sep 17 00:00:00 2001 From: svilayphiou Date: Thu, 6 Dec 2018 14:09:00 +0100 Subject: [PATCH 1/3] Added pip requirements from git repos --- requirements.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/requirements.txt b/requirements.txt index 598cc25..5f6cef5 100755 --- a/requirements.txt +++ b/requirements.txt @@ -20,4 +20,7 @@ flask-socketio==2.9.2 flask-whooshalchemyplus==0.7.5 python-dotenv==0.7.1 autocomplete==0.0.104 +git+https://github.com/rqlite/pyrqlite.git +git+https://github.com/rqlite/sqlalchemy-rqlite.git +git+https://github.com/Kozea/Flask-WeasyPrint.git From 342b82c467135b5d609d070126f6f07e23b4f8e5 Mon Sep 17 00:00:00 2001 From: svilayphiou Date: Thu, 6 Dec 2018 14:15:08 +0100 Subject: [PATCH 2/3] Reorganizing installation instructions Reorganizing installation instructions + better Markdown formatting of commands (copy&paste wouldn't work) --- README.md | 88 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 46 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index a677a9c..f5374dd 100644 --- a/README.md +++ b/README.md @@ -1,77 +1,81 @@ # XPUB Library Library running on Flask and SQLight (maybe to be replaced with a python shelve) -requirements.txt -$ pip3 install -r requirements.txt +## Installation -install rqlite -install pyrqlite -install sqlalchemy-rqlite +Install the required dependencies: -initialize rqlite database -$ ./rqlited ~.node + $ pip3 install -r requirements.txt -initialise database -$ bash init_db.sh -run script -python3 run.py +Initialise database + $ bash init_db.sh -## API -has currently 2 entrypoints: +### Install rqlite -/api/books -GETs all the books in the database +#### Linux +To download and start rqlite on Linux, execute the following in a shell. -/api/book/id -GETs a specific book by its id + curl -L https://github.com/rqlite/rqlite/releases/download/v4.3.0/rqlite-v4.3.0-linux-amd64.tar.gz -o rqlite-v4.3.0-linux-amd64.tar.gz + tar xvfz rqlite-v4.3.0-linux-amd64.tar.gz + cd rqlite-v4.3.0-linux-amd64 + ./rqlited ~/node.1 -## Installation -Further installnotes (bugs) +#### OSX +To download and start rqlite on OSX, execute the following in a shell. + +curl -L https://github.com/rqlite/rqlite/releases/download/v4.3.0/rqlite-v4.3.0-darwin-amd64.tar.gz -o rqlite-v4.3.0-darwin-amd64.tar.gz +tar xvfz rqlite-v4.3.0-darwin-amd64.tar.gz +cd rqlite-v4.3.0-darwin-amd64 +./rqlited ~/node.1 + + + + +### Further install notes (bugs) * create the covers folder inside the uploadsfolder * don't forget to chmod the uploads and coverfolder ;-) -* For Macusers -> brew install imagemagick@6 in order to install wand +* For Mac users -> brew install imagemagick@6 in order to install wand For those on mac and using homebrew, it seems like Wand doesn't support imagemagick 7 yet as mentioned in other answers. There's a new brew formula for Imagemagick 6 which can be used to install the older version in the meanwhile: -brew install imagemagick@6 +`brew install imagemagick@6` + Create a symlink to this newly installed dylib file as mentioned in other answer to get things working. -ln -s /usr/local/Cellar/imagemagick@6//lib/libMagickWand-6.Q16.dylib /usr/local/lib/libMagickWand.dylib + ln -s /usr/local/Cellar/imagemagick@6//lib/libMagickWand-6.Q16.dylib /usr/local/lib/libMagickWand.dylib -## install rqlite -### Linux -To download and start rqlite on Linux, execute the following in a shell. -curl -L https://github.com/rqlite/rqlite/releases/download/v4.3.0/rqlite-v4.3.0-linux-amd64.tar.gz -o rqlite-v4.3.0-linux-amd64.tar.gz -tar xvfz rqlite-v4.3.0-linux-amd64.tar.gz -cd rqlite-v4.3.0-linux-amd64 -./rqlited ~/node.1 -### OSX -To download and start rqlite on OSX, execute the following in a shell. -curl -L https://github.com/rqlite/rqlite/releases/download/v4.3.0/rqlite-v4.3.0-darwin-amd64.tar.gz -o rqlite-v4.3.0-darwin-amd64.tar.gz -tar xvfz rqlite-v4.3.0-darwin-amd64.tar.gz -cd rqlite-v4.3.0-darwin-amd64 -./rqlited ~/node.1 +## Run the program + +Initialize rqlite database on one terminal (from rqlite install directory) + + $ ./rqlited ~.node -## install pyrqlite +Run the script in another terminal (from XPPL directory): -git clone https://github.com/rqlite/pyrqlite.git -pip install ./pyrqlite + python3 run.py -## install sqlalchemy-rqlite -git clone https://github.com/rqlite/sqlalchemy-rqlite.git -cd sqlalchemy-rqlite -sudo python3 ./setup.py install + + +## API + +Has currently 2 entrypoints: + +`/api/books` +GETs all the books in the database + +`/api/book/id` +GETs a specific book by its id From 2df338a56a2d69a2b5ef2c4994de3fd0e1a8e63f Mon Sep 17 00:00:00 2001 From: svilayphiou Date: Thu, 6 Dec 2018 14:24:38 +0100 Subject: [PATCH 3/3] add requests requirement --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 5f6cef5..f8e94e1 100755 --- a/requirements.txt +++ b/requirements.txt @@ -23,4 +23,4 @@ autocomplete==0.0.104 git+https://github.com/rqlite/pyrqlite.git git+https://github.com/rqlite/sqlalchemy-rqlite.git git+https://github.com/Kozea/Flask-WeasyPrint.git - +requests=2.20.1