.gitignore | ||
acronyms_to_lookup.py | ||
LICENSE | ||
main.py | ||
README.md | ||
tests.py | ||
wikipedia_acronym_dictionary.py |
Wikipedia Acronym Dictionary
Did you ever feel that there were many acronyms to know about and to memorize? Did you ever feel like it only gets worse with time, because of how fast technologies grow?
This program aims to simplify the search for a Wikipedia definition. Instead of opening your browser and searching on Wikipedia the usual way, put this script in your PATH. This way you can access a Wikipedia definition right from the console.
Dependencies
The two libraries we use are Requests and BeautifulSoup. It goes without saying, this program won't work without them.
pip3 install requests
pip3 install bs4
Quick start
If the dependencies are satisfied, using Wikipedia Acronym Dictionary is rather straightforward: Just run the main script and pass it a search word. It then prints the definition.
The idea though is to run this from the command line, say whenever you stumble uppon a definition to find. So put this script in your PATH so it is accessible from anywhere. For example:
sudo ln -rs main.py /usr/local/bin/wiki-acronym-dict
Notes
The intended use was originally to populate a Python dictionary, with the search words as keys and the definitions as values. This has not been implemented, and probably won't be, because of limited usability. The more probable way to go is maintaining a list of acronyms to know about, and searching for them using the WikipediaAcronymDictionary class.
This is work in progress
The script has only been tested with a limited number of words, so the scraping still needs to be improved for it to return the correct page of any query.