Skip to main content

A pseudo-API for that works by scraping its website.

Project description


dictcom is a simple Python package that extract dictionary info from via web scraping. It can be thought of as an unofficial “API” for


dictcom is available on PyPI:

$ pip install dictcom

Currently it only works under Python 3. Tested with Python 3.4 and 3.5.


The package itself exposes two main methods, get_word and get_word_pronunciation.

get_word downloads all the data found for the word provided and packages it into a Word object:

import dictcom
word = dictcom.get_word('something')  # an instance of dictcom.models.Word

You can access the word’s pronunciation (the textual representation of it) via the pronunciation property:

word.pronunciation # '[suhm-thing]'

The definitions are found under the defs property, as a dictionary. Each key of the dictionary represents one definition subsection, which usually means a different part of speech (for example noun or pronoun):

word.defs.keys() # ['pronoun', 'noun', 'adverb']

The value under each key is a list of Definition instances. Each definition has two properties, text and example.

One can also download the audio file for the word’s pronunciation:

pronun = word.get_pronunciation_audio() # an instance of dictcom.models.WordPronunciation # raw audio buffer
pronun.content_type # the MIME type of the buffer data

You can also immediately get the pronunciation audio with get_word_pronunciation, the other method exposed by the package.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dictcom-0.0.3.tar.gz (3.6 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page