diff --git a/README.md b/README.md index f5420933068aac0e652f2322e1c3a95e55c9d272..9929e63a0a7963127e62a42ff65e9b7f6b0f830b 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 0000000000000000000000000000000000000000..9a6b3d4292473c38ba84133651fa862ffb47e31b --- /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 0000000000000000000000000000000000000000..7b497903233ebdf63939017720554833d2b76f7f --- /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