diff --git a/README.md b/README.md index 89e9447b361d752c6b86d5cbfe60e36ced9f7ae3..d16ed75e693fe59401decd9f75cacafa7e45bba3 100644 --- a/README.md +++ b/README.md @@ -14,11 +14,11 @@ This project does depend on python packages. * [``importlib``](https://docs.python.org/3/library/importlib.html) : to import parser modules ## Installation -(maybe to be replaced by an automation of some sort) +(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 importlib```](https://pypi.org/project/importlib/) -_Optional (for python 2.*)_ +_Optional (for python 2.*, not tested)_ ### 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). @@ -33,6 +33,7 @@ pip install -U flask-cors #install Flask cors ## Use ### Wikstraktor +#### Python ```python from wikstraktor import Wikstraktor f = Wikstraktor.get_instance('fr', 'en') #create a wikstraktor, @@ -42,6 +43,30 @@ f.fetch("blue") #fetch an article str(f) #convert content to json ``` +#### Bash +``` +usage: wikstraktor.py [-h] [-l LANGUAGE] [-w WIKI_LANGUAGE] [-m MOT] + [-f DESTINATION_FILE] [-A] [-C] + +Interroger un wiktionnaire + ex : + ‣./wikstraktor.py -m blue + ‣./wikstraktor.py -m blue -f blue.json -A -C + ‣./wikstraktor.py -l en -w fr -m blue -f blue.json -A -C + +options: + -h, --help show this help message and exit + -l LANGUAGE, --language LANGUAGE + la langue du mot + -w WIKI_LANGUAGE, --wiki_language WIKI_LANGUAGE + la langue du wiki + -m MOT, --mot MOT le mot à chercher + -f DESTINATION_FILE, --destination_file DESTINATION_FILE + le fichier dans lequel stocker le résultat + -A, --force_ascii json avec que des caractères ascii + -C, --compact json sans indentation +``` + ### Wikstraktor Server The server runs by default on port 5000, you can change that in the ```wikstraktor_server_config.py``` file. ```bash