NatLibFi / Annif

Annif is a multi-algorithm automated subject indexing tool for libraries, archives and museums.
https://annif.org
Other
204 stars 41 forks source link

Make it possible to set the path to projects.cfg with a command line option #210

Closed osma closed 5 years ago

osma commented 6 years ago

As noted in #195, it should be possible to set the path to projects.cfg using a command line option. For example like this:

annif --projects /etc/annif/projects.cfg analyze tfidf-en <file.txt

Or just annif -p /etc/annif/projects.cfg as a shortcut

juhoinkinen commented 5 years ago

Note: The application context via current_app is not available in callbacks: https://github.com/pallets/flask/issues/2410

For this reason the with: block in set_project_config_file_path() is needed: https://github.com/NatLibFi/Annif/blob/master/annif/cli.py#L80