Skip to content

Examples

Cache

All underlying api calls to the official datamuse api are always cached via the functools.lru_cache.

The cache is separate for the words and suggestions api.

In order to find:

  • words with a meaning similar to examples

    from datamuse import Datamuse
    
    muse = Datamuse()
    muse.synonyms("examples")
    
    >>>
    >>> ['representative', 'exemplar', 'lesson']
    >>>
    

  • suggestions for the user if they have typed in the word programm so far

    from datamuse import Datamuse
    
    muse = Datamuse()
    muse.suggestions("programm")
    
    >>>
    >>> ['programme', 'programming language', 'programmed']
    >>>