From 7d6659de6941a592daa7d028160c063fd2d95fcf Mon Sep 17 00:00:00 2001 From: Mathieu Loiseau <mathieu.loiseau@liris.cnrs.fr> Date: Thu, 22 Jun 2023 15:22:29 +0200 Subject: [PATCH] improve installation --- README.md | 25 ++++++++++++++++--------- requirements.txt | 7 +++++++ server_requirements.txt | 5 +++++ 3 files changed, 28 insertions(+), 9 deletions(-) create mode 100644 requirements.txt create mode 100644 server_requirements.txt diff --git a/README.md b/README.md index f542093..9929e63 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ wikstraktor A python tool to query the [wiktionary](https://wiktionary.org) and extract [structured lexical data](https://gitlab.liris.cnrs.fr/lex-game/wikstraktor/-/wikis/Entry-structure). +This experimentally identifies every structured info and merges info from different sources. + ## Dependencies This project does depend on python packages. * [``pywikibot``](https://github.com/wikimedia/pywikibot) allows to use the mediawiki API @@ -12,16 +14,21 @@ This project does depend on python packages. * [``wikitextparser``](https://github.com/5j9/wikitextparser) can parse mediawiki pages and extract sections, templates and links * [documentation](https://wikitextparser.readthedocs.io/en/latest/#api-reference) * [``importlib``](https://docs.python.org/3/library/importlib.html) : to import parser modules +* [``sqlite3``](https://docs.python.org/3/library/sqlite3.html) For logs +* [``gitpython``](https://gitpython.readthedocs.io/en/stable/) for logs +* [``json``](https://docs.python.org/3/library/json.html) for json use +* [``re``](https://docs.python.org/3/library/re.html) ## Installation (maybe to be replaced by an automation of some sort, using a virtual environment might be better, see [server version](#wikstraktor-server)) -* [```pip install pywikibot```](https://pypi.org/project/pywikibot/) -* [```pip install wikitextparser```](https://pypi.org/project/wikitextparser/) -* [```pip install gitpython```](https://gitpython.readthedocs.io/en/stable/) -* [```pip install sqlite3```](https://docs.python.org/3/library/sqlite3.html) Might be provided with python -* [```pip install importlib```](https://pypi.org/project/importlib/) -_Optional (for python 2.*, not tested)_ -* run ``./setup.py`` (used to store wikstraktor version in wiktionary extracts) + +### Basic version +```bash +python3 -m venv wikstraktorenv #optional for basic version +. wikstraktorenv/bin/activate #activate environment (optional) +pip install -r requirements.txt +run ./setup.py +``` ### Wikstraktor Server If you want wikstraktor as a server, you need to install [flask](https://flask.palletsprojects.com/en/2.0.x/installation/) and [flask-cors](https://flask-cors.readthedocs.io/en/latest/) — to allow other domains to query —, and best practice is to do so in a [virtual environment](https://docs.python.org/3/library/venv.html#module-venv). @@ -30,8 +37,8 @@ The following commands are extracted from the aforementionned documentation, it ```bash python3 -m venv wikstraktorenv #create wikstraktorenv environment . wikstraktorenv/bin/activate #activate environment -pip install Flask #install Flask -pip install -U flask-cors #install Flask cors +pip install -r server_requirements.txt +run ./setup.py ``` ## Use diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..9a6b3d4 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,7 @@ +#necessary +pywikibot>=8.1.2 +wikitextparser>=0.51.0 +importlib>=1.0.4 + +#for setup script +GitPython==3.1.31 diff --git a/server_requirements.txt b/server_requirements.txt new file mode 100644 index 0000000..7b49790 --- /dev/null +++ b/server_requirements.txt @@ -0,0 +1,5 @@ +#for server version +Flask==2.2.2 +Flask-Cors==3.0.10 + +-r requirements.txt -- GitLab