Skip to main content

Library for querying the Duck Duck Go API, updated for python3

Project description

A Python library for querying the Duck Duck Go API.

Copyright Michael Stephens <me@mikej.st>, released under a BSD-style license.

Updated for Python3 by Jacobi Petrucciani <jacobi@mimirhq.com>

Source: https://github.com/jpetrucciani/python-duckduckgo

Installation

To install run

pip install ddg3

or

python setup.py install

Usage

>>> import ddg3
>>> r = ddg3.query('Duck Duck Go')
>>> r.type
'answer'
>>> r.results[0].text
'Official site'
>>> r.results[0].url
'http://duckduckgo.com/'
>>> r.abstract.url
'http://en.wikipedia.org/wiki/Duck_Duck_Go'
>>> r.abstract.source
'Wikipedia'
>>> r = ddg3.query('Python')
>>> r.type
'disambiguation'
>>> r.related[6].text
'Python (programming language), a computer programming language'
>>> r.related[6].url
'http://duckduckgo.com/Python_(programming_language)'
>>> r = ddg3.query('1 + 1')
>>> r.type
'nothing'
>>> r.answer.text
'1 + 1 = 2'
>>> r.answer.type
'calc'

Project details


Download files

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

Files for ddg3, version 0.6.6
Filename, size File type Python version Upload date Hashes
Filename, size ddg3-0.6.6-py2.py3-none-any.whl (4.9 kB) File type Wheel Python version py2.py3 Upload date Hashes View

Supported by

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