regenerated client

This commit is contained in:
Tony Tam 2014-06-10 10:36:13 -07:00
parent 85113df113
commit b78721826e
5 changed files with 226 additions and 0 deletions

View File

@ -29,13 +29,17 @@ class AccountApi(object):
self.apiClient = apiClient
def authenticate(self, username, password, **kwargs):
"""Authenticates a User
Args:
username, str: A confirmed Wordnik username (required)
password, str: The user's password (required)
Returns: AuthenticationToken
"""
@ -72,14 +76,19 @@ class AccountApi(object):
responseObject = self.apiClient.deserialize(response, 'AuthenticationToken')
return responseObject
def authenticatePost(self, username, body, **kwargs):
"""Authenticates a user
Args:
username, str: A confirmed Wordnik username (required)
body, str: The user's password (required)
Returns: AuthenticationToken
"""
@ -114,15 +123,21 @@ class AccountApi(object):
responseObject = self.apiClient.deserialize(response, 'AuthenticationToken')
return responseObject
def getWordListsForLoggedInUser(self, auth_token, **kwargs):
"""Fetches WordList objects for the logged-in user.
Args:
auth_token, str: auth_token of logged-in user (required)
skip, int: Results to skip (optional)
limit, int: Maximum number of results to return (optional)
Returns: list[WordList]
"""
@ -159,13 +174,17 @@ class AccountApi(object):
responseObject = self.apiClient.deserialize(response, 'list[WordList]')
return responseObject
def getApiTokenStatus(self, **kwargs):
"""Returns usage statistics for the API account.
Args:
api_key, str: Wordnik authentication token (optional)
Returns: ApiTokenStatus
"""
@ -198,13 +217,17 @@ class AccountApi(object):
responseObject = self.apiClient.deserialize(response, 'ApiTokenStatus')
return responseObject
def getLoggedInUser(self, auth_token, **kwargs):
"""Returns the logged-in User
Args:
auth_token, str: The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above) (required)
Returns: User
"""
@ -237,7 +260,11 @@ class AccountApi(object):
responseObject = self.apiClient.deserialize(response, 'User')
return responseObject

View File

@ -29,16 +29,23 @@ class WordApi(object):
self.apiClient = apiClient
def getExamples(self, word, **kwargs):
"""Returns examples for a word
Args:
word, str: Word to return examples for (required)
includeDuplicates, str: Show duplicate examples from different sources (optional)
useCanonical, str: If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested. (optional)
skip, int: Results to skip (optional)
limit, int: Maximum number of results to return (optional)
Returns: ExampleSearchResults
"""
@ -81,15 +88,21 @@ class WordApi(object):
responseObject = self.apiClient.deserialize(response, 'ExampleSearchResults')
return responseObject
def getWord(self, word, **kwargs):
"""Given a word as a string, returns the WordObject that represents it
Args:
word, str: String value of WordObject to return (required)
useCanonical, str: If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested. (optional)
includeSuggestions, str: Return suggestions (for correct spelling, case variants, etc.) (optional)
Returns: WordObject
"""
@ -128,19 +141,29 @@ class WordApi(object):
responseObject = self.apiClient.deserialize(response, 'WordObject')
return responseObject
def getDefinitions(self, word, **kwargs):
"""Return definitions for a word
Args:
word, str: Word to return definitions for (required)
partOfSpeech, str: CSV list of part-of-speech types (optional)
sourceDictionaries, str: Source dictionary to return definitions from. If 'all' is received, results are returned from all sources. If multiple values are received (e.g. 'century,wiktionary'), results are returned from the first specified dictionary that has definitions. If left blank, results are returned from the first dictionary that has definitions. By default, dictionaries are searched in this order: ahd, wiktionary, webster, century, wordnet (optional)
limit, int: Maximum number of results to return (optional)
includeRelated, str: Return related words with definitions (optional)
useCanonical, str: If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested. (optional)
includeTags, str: Return a closed set of XML tags in response (optional)
Returns: list[Definition]
"""
@ -187,14 +210,19 @@ class WordApi(object):
responseObject = self.apiClient.deserialize(response, 'list[Definition]')
return responseObject
def getTopExample(self, word, **kwargs):
"""Returns a top example for a word
Args:
word, str: Word to fetch examples for (required)
useCanonical, str: If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested. (optional)
Returns: Example
"""
@ -231,16 +259,23 @@ class WordApi(object):
responseObject = self.apiClient.deserialize(response, 'Example')
return responseObject
def getRelatedWords(self, word, **kwargs):
"""Given a word as a string, returns relationships from the Word Graph
Args:
word, str: Word to fetch relationships for (required)
relationshipTypes, str: Limits the total results per type of relationship type (optional)
useCanonical, str: If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested. (optional)
limitPerRelationshipType, int: Restrict to the supplied relatinship types (optional)
Returns: list[Related]
"""
@ -281,17 +316,25 @@ class WordApi(object):
responseObject = self.apiClient.deserialize(response, 'list[Related]')
return responseObject
def getTextPronunciations(self, word, **kwargs):
"""Returns text pronunciations for a given word
Args:
word, str: Word to get pronunciations for (required)
sourceDictionary, str: Get from a single dictionary (optional)
typeFormat, str: Text pronunciation type (optional)
useCanonical, str: If true will try to return a correct word root ('cats' -> 'cat'). If false returns exactly what was requested. (optional)
limit, int: Maximum number of results to return (optional)
Returns: list[TextPron]
"""
@ -334,16 +377,23 @@ class WordApi(object):
responseObject = self.apiClient.deserialize(response, 'list[TextPron]')
return responseObject
def getHyphenation(self, word, **kwargs):
"""Returns syllable information for a word
Args:
word, str: Word to get syllables for (required)
sourceDictionary, str: Get from a single dictionary. Valid options: ahd, century, wiktionary, webster, and wordnet. (optional)
useCanonical, str: If true will try to return a correct word root ('cats' -> 'cat'). If false returns exactly what was requested. (optional)
limit, int: Maximum number of results to return (optional)
Returns: list[Syllable]
"""
@ -384,16 +434,23 @@ class WordApi(object):
responseObject = self.apiClient.deserialize(response, 'list[Syllable]')
return responseObject
def getWordFrequency(self, word, **kwargs):
"""Returns word usage over time
Args:
word, str: Word to return (required)
useCanonical, str: If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested. (optional)
startYear, int: Starting Year (optional)
endYear, int: Ending Year (optional)
Returns: FrequencySummary
"""
@ -434,16 +491,23 @@ class WordApi(object):
responseObject = self.apiClient.deserialize(response, 'FrequencySummary')
return responseObject
def getPhrases(self, word, **kwargs):
"""Fetches bi-gram phrases for a word
Args:
word, str: Word to fetch phrases for (required)
limit, int: Maximum number of results to return (optional)
wlmi, int: Minimum WLMI for the phrase (optional)
useCanonical, str: If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested. (optional)
Returns: list[Bigram]
"""
@ -484,14 +548,19 @@ class WordApi(object):
responseObject = self.apiClient.deserialize(response, 'list[Bigram]')
return responseObject
def getEtymologies(self, word, **kwargs):
"""Fetches etymology data
Args:
word, str: Word to return (required)
useCanonical, str: If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested. (optional)
Returns: list[str]
"""
@ -528,15 +597,21 @@ class WordApi(object):
responseObject = self.apiClient.deserialize(response, 'list[str]')
return responseObject
def getAudio(self, word, **kwargs):
"""Fetches audio metadata for a word.
Args:
word, str: Word to get audio for. (required)
useCanonical, str: Use the canonical form of the word (optional)
limit, int: Maximum number of results to return (optional)
Returns: list[AudioFile]
"""
@ -575,13 +650,17 @@ class WordApi(object):
responseObject = self.apiClient.deserialize(response, 'list[AudioFile]')
return responseObject
def getScrabbleScore(self, word, **kwargs):
"""Returns the Scrabble score for a word
Args:
word, str: Word to get scrabble score for. (required)
Returns: ScrabbleScoreResult
"""
@ -616,7 +695,11 @@ class WordApi(object):
responseObject = self.apiClient.deserialize(response, 'ScrabbleScoreResult')
return responseObject

View File

@ -29,14 +29,19 @@ class WordListApi(object):
self.apiClient = apiClient
def updateWordList(self, permalink, auth_token, **kwargs):
"""Updates an existing WordList
Args:
permalink, str: permalink of WordList to update (required)
body, WordList: Updated WordList (optional)
auth_token, str: The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above) (required)
Returns:
"""
@ -68,14 +73,19 @@ class WordListApi(object):
postData, headerParams)
def deleteWordList(self, permalink, auth_token, **kwargs):
"""Deletes an existing WordList
Args:
permalink, str: ID of WordList to delete (required)
auth_token, str: The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above) (required)
Returns:
"""
@ -107,14 +117,19 @@ class WordListApi(object):
postData, headerParams)
def getWordListByPermalink(self, permalink, auth_token, **kwargs):
"""Fetches a WordList by ID
Args:
permalink, str: permalink of WordList to fetch (required)
auth_token, str: The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above) (required)
Returns: WordList
"""
@ -151,15 +166,21 @@ class WordListApi(object):
responseObject = self.apiClient.deserialize(response, 'WordList')
return responseObject
def addWordsToWordList(self, permalink, auth_token, **kwargs):
"""Adds words to a WordList
Args:
permalink, str: permalink of WordList to user (required)
body, list[StringValue]: Array of words to add to WordList (optional)
auth_token, str: The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above) (required)
Returns:
"""
@ -191,18 +212,27 @@ class WordListApi(object):
postData, headerParams)
def getWordListWords(self, permalink, auth_token, **kwargs):
"""Fetches words in a WordList
Args:
permalink, str: ID of WordList to use (required)
auth_token, str: The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above) (required)
sortBy, str: Field to sort by (optional)
sortOrder, str: Direction to sort (optional)
skip, int: Results to skip (optional)
limit, int: Maximum number of results to return (optional)
Returns: list[WordListWord]
"""
@ -247,15 +277,21 @@ class WordListApi(object):
responseObject = self.apiClient.deserialize(response, 'list[WordListWord]')
return responseObject
def deleteWordsFromWordList(self, permalink, auth_token, **kwargs):
"""Removes words from a WordList
Args:
permalink, str: permalink of WordList to use (required)
body, list[StringValue]: Words to remove from WordList (optional)
auth_token, str: The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above) (required)
Returns:
"""
@ -287,7 +323,11 @@ class WordListApi(object):
postData, headerParams)

View File

@ -29,13 +29,17 @@ class WordListsApi(object):
self.apiClient = apiClient
def createWordList(self, auth_token, **kwargs):
"""Creates a WordList.
Args:
body, WordList: WordList to create (optional)
auth_token, str: The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above) (required)
Returns: WordList
"""
@ -68,7 +72,11 @@ class WordListsApi(object):
responseObject = self.apiClient.deserialize(response, 'WordList')
return responseObject

View File

@ -29,23 +29,37 @@ class WordsApi(object):
self.apiClient = apiClient
def searchWords(self, query, **kwargs):
"""Searches words
Args:
query, str: Search query (required)
includePartOfSpeech, str: Only include these comma-delimited parts of speech (optional)
excludePartOfSpeech, str: Exclude these comma-delimited parts of speech (optional)
caseSensitive, str: Search case sensitive (optional)
minCorpusCount, int: Minimum corpus frequency for terms (optional)
maxCorpusCount, int: Maximum corpus frequency for terms (optional)
minDictionaryCount, int: Minimum number of dictionary entries for words returned (optional)
maxDictionaryCount, int: Maximum dictionary definition count (optional)
minLength, int: Minimum word length (optional)
maxLength, int: Maximum word length (optional)
skip, int: Results to skip (optional)
limit, int: Maximum number of results to return (optional)
Returns: WordSearchResults
"""
@ -102,13 +116,17 @@ class WordsApi(object):
responseObject = self.apiClient.deserialize(response, 'WordSearchResults')
return responseObject
def getWordOfTheDay(self, **kwargs):
"""Returns a specific WordOfTheDay
Args:
date, str: Fetches by date in yyyy-MM-dd (optional)
Returns: WordOfTheDay
"""
@ -141,28 +159,47 @@ class WordsApi(object):
responseObject = self.apiClient.deserialize(response, 'WordOfTheDay')
return responseObject
def reverseDictionary(self, query, **kwargs):
"""Reverse dictionary search
Args:
query, str: Search term (required)
findSenseForWord, str: Restricts words and finds closest sense (optional)
includeSourceDictionaries, str: Only include these comma-delimited source dictionaries (optional)
excludeSourceDictionaries, str: Exclude these comma-delimited source dictionaries (optional)
includePartOfSpeech, str: Only include these comma-delimited parts of speech (optional)
excludePartOfSpeech, str: Exclude these comma-delimited parts of speech (optional)
expandTerms, str: Expand terms (optional)
sortBy, str: Attribute to sort by (optional)
sortOrder, str: Sort direction (optional)
minCorpusCount, int: Minimum corpus frequency for terms (optional)
maxCorpusCount, int: Maximum corpus frequency for terms (optional)
minLength, int: Minimum word length (optional)
maxLength, int: Maximum word length (optional)
includeTags, str: Return a closed set of XML tags in response (optional)
skip, str: Results to skip (optional)
limit, int: Maximum number of results to return (optional)
Returns: DefinitionSearchResults
"""
@ -225,24 +262,39 @@ class WordsApi(object):
responseObject = self.apiClient.deserialize(response, 'DefinitionSearchResults')
return responseObject
def getRandomWords(self, **kwargs):
"""Returns an array of random WordObjects
Args:
includePartOfSpeech, str: CSV part-of-speech values to include (optional)
excludePartOfSpeech, str: CSV part-of-speech values to exclude (optional)
sortBy, str: Attribute to sort by (optional)
sortOrder, str: Sort direction (optional)
hasDictionaryDef, str: Only return words with dictionary definitions (optional)
minCorpusCount, int: Minimum corpus frequency for terms (optional)
maxCorpusCount, int: Maximum corpus frequency for terms (optional)
minDictionaryCount, int: Minimum dictionary count (optional)
maxDictionaryCount, int: Maximum dictionary count (optional)
minLength, int: Minimum word length (optional)
maxLength, int: Maximum word length (optional)
limit, int: Maximum number of results to return (optional)
Returns: list[WordObject]
"""
@ -297,21 +349,33 @@ class WordsApi(object):
responseObject = self.apiClient.deserialize(response, 'list[WordObject]')
return responseObject
def getRandomWord(self, **kwargs):
"""Returns a single random WordObject
Args:
includePartOfSpeech, str: CSV part-of-speech values to include (optional)
excludePartOfSpeech, str: CSV part-of-speech values to exclude (optional)
hasDictionaryDef, str: Only return words with dictionary definitions (optional)
minCorpusCount, int: Minimum corpus frequency for terms (optional)
maxCorpusCount, int: Maximum corpus frequency for terms (optional)
minDictionaryCount, int: Minimum dictionary count (optional)
maxDictionaryCount, int: Maximum dictionary count (optional)
minLength, int: Minimum word length (optional)
maxLength, int: Maximum word length (optional)
Returns: WordObject
"""
@ -360,7 +424,11 @@ class WordsApi(object):
responseObject = self.apiClient.deserialize(response, 'WordObject')
return responseObject