Welcome to Pythonary’s documentation!¶
A python module/libary that retrieves information about words from dictionaries!
Instalation Guide¶
Checking if installed¶
Open the cmd and open the python interactive mode!
>>> import pythonary
If no error occurs you have successfully installed Pythonary!
Whats New?¶
When an update is posted, a short description about it will be posted here.
About the version numbers:
- 1.0.0 = New major version.
- 0.1.0 = New feature.
- 0.0.1 = A minor fix.
1.0.1¶
Added documentation.
1.0.0¶
Added Oxford Support to Pythonary!
This includes:
Select
, parsed
, name
, etymologies
, definition
, short_definition
, example
, sub_definition
, sub_short_definition
, sub_example
, language_code
, category
, audiofile
, audiofile_dialect
, phonetic
, phonetic_notation
Added Main structure. (
utils
, errors
)Oxford Quick Start¶
First of all you need an official Oxford
app_id
and app_key
.You can get this from Oxford Dictionaries Developer.
>>> from pythonary import Oxford
>>> app = Oxford.Dictionary(app_id="YourAppID",
... app_key="YourAppKey")
>>> app.Select(word="example")
>>> app.name()
<<< example
This will return the name from the word. (so the word itself)
Oxford Reference¶
Dictionary¶
Represents a dictionary from the Oxford Dictionaries,
This class connects to the Oxford Dictionaries API and receives information.
Arguments for Dictionary:
Parameters:
- app_id: Required[str]
The application id is used to connect to Oxford Dictionaries.Receive your application id here.
- app_key: Required[str]
The application key is used to connect to Oxford Dictionaries.Receive your application key here.
Example:
>>> from pythonary import Oxford
>>> app = Oxford.Dictionary(app_id="YourAppID",
... app_key="YourAppKey",
... language="en-gb")
Select¶
Select a word, per select 1 API request gets sent.
You can only use all the other commands when a word is selected.
Using the API this way leads to less requests and equal information!
Parameters:
- word: Required[str]
The word you want to have selected, this word must be in the singular form.
Example:
>>> from pythonary import Oxford
>>> app = Oxford.Dictionary(app_id="YourAppID",
... app_key="YourAppKey")
>>> app.Select("example")
parsed¶
Returns:
- data[dict]
Example:
>>> from pythonary import Oxford
>>> app = Oxford.Dictionary(app_id="YourAppID",
... app_key="YourAppKey")
>>> app.Select("example")
>>> app.parsed()
<<< {'raw':[{'json':'data', 'in':'a', 'python':'dictionary'}]}
sub_example¶
Retrieve an sub sentence where the selected word is in as example.
Returns:
- example[str]
language_code¶
Retrieve the selected word its language_code, this should be your custom inserted one.
If none was given “en” will be the code as its the default one, when its “en”, “en-us” ect are also included.
Returns:
- code[str]