From 6afa1ee86bf04f0b75188de309173c6a3bce9834 Mon Sep 17 00:00:00 2001 From: Empiriker <till.ueberfries@gmail.com> Date: Mon, 11 Sep 2023 17:43:11 +0200 Subject: [PATCH] update Readme and requirements --- README.md | 41 ++++++++++++++++++++++++++++++++--------- requirements.txt | 3 ++- 2 files changed, 34 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 10310d1..e28d016 100644 --- a/README.md +++ b/README.md @@ -2,21 +2,44 @@ ## Installation -1. Install wikitextprocessor from source: +Wiktionary dump files need to be downloaded manually. +0. Download Wiktionary dumpfiles from https://dumps.wikimedia.org/ and place at ./dumps/ + +### Local python environment + +1. Create a virtual environment + +``` +virtualenv live-query-wiktextract +source live-query-wiktextract/bin/activate ``` -git clone https://github.com/tatuylonen/wikitextprocessor.git -cd wikitextprocessor -python -m pip install -U pip -python -m pip install --use-pep517 . + +2. Install requirements.txt + +``` +pip install -r requirements.txt ``` -- Commit `e5296c16f2d715e62121f23cb5057374da48cda3` was used during development. +_Since wiktextract is not regularly published as a Python package, we fix version control to a specific commit. That commit was used and tested during development._ -2. Clone wiktextract +### Using Docker ``` -https://github.com/tatuylonen/wiktextract.git +docker build -t live-query-wiktextract . ``` -- Commit `205c4a2d88c27113f0117e0095f466605976af81` was used during development. +## Usage + +### With local environment + +``` +python src/load_templates.py +flask --app src/app.py run --debug +``` + +### Using Docker + +``` +docker run -p 5000:80 live-query-wiktextract +``` diff --git a/requirements.txt b/requirements.txt index c799dfc..0e2b663 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ pywikibot==8.3.2 Flask==2.3.3 -flask_cors==4.0.0 \ No newline at end of file +flask_cors==4.0.0 +wiktextract @ git+https://github.com/tatuylonen/wiktextract.git@205c4a2d88c27113f0117e0095f466605976af81 -- GitLab