Wordnet interface library
copied from cf-staging / wnWn is a Python library for exploring information in wordnets. Install it from PyPI and download some data:
$ pip install wn
$ python -m wn download oewn:2021 # the Open English WordNet 2021
Then start exploring:
>>> import wn
>>> en = wn.Wordnet('oewn:2021') # Create Wordnet object to query
>>> ss = en.synsets('win')[0] # Get the first synset for 'win'
>>> ss.definition() # Get the synset's definition
'be the winner in a contest or competition; be victorious'