This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

DuckDuckPy is a Python library for querying DuckDuckGo API and render results either to Python dictionary or namedtuple.


  • Uses standard library only
  • Works on Python 2.6 and 2.7
  • Unit test coverage 100%
  • SSL and unicode support
  • Licensed under MIT license


You can install DuckDuckPy either via the Python Package Index (PyPI) or from source.

To install using pip:

$ pip install duckduckpy

To install using easy_install:

$ easy_install duckduckpy

To install from sources you can download the latest version of DuckDuckPy either from PyPI or GitHub, extract archive contents and run following command from the source directory:

$ python install

Latest upstream version can be installed directly from the git repository:

$ pip install git+

API description

>>> from duckduckpy import query
>>> help(query)
Help on function query in module duckduckpy.core:

query(query_string, secure=False, container=u'namedtuple', verbose=False,
      user_agent=u'duckduckpy 0.1', no_redirect=False, no_html=False,

    Generates and sends a query to DuckDuckGo API.

        query_string: Query to be passed to DuckDuckGo API.
        secure: Use secure SSL/TLS connection. Default - False.
            Syntactic sugar is secure_query function which is passed the same
        container: Indicates how dict-like objects are serialized. There are
           two possible options: namedtuple and dict. If 'namedtuple' is passed
           the objects will be serialized to namedtuple instance of certain
           class. If 'dict' is passed the objects won't be deserialized.
           Default value: 'namedtuple'.
        verbose: Don't raise any exception if error occurs.
            Default value: False.
        user_agent: User-Agent header of HTTP requests to DuckDuckGo API.
            Default value: 'duckduckpy 0.1'
        no_redirect: Skip HTTP redirects (for !bang commands).
            Default value: False.
        no_html: Remove HTML from text, e.g. bold and italics.
            Default value: False.
        skip_disambig: Skip disambiguation (D) Type. Default value: False.

        DuckDuckDeserializeError: JSON serialization failed.
        DuckDuckConnectionError: Something went wrong with httplib operation.
        DuckDuckArgumentError: Passed argument is wrong.

        Container depends on container parameter. Each field in the response is
        converted to the so-called snake case.


>>> from duckduckpy import query
>>> response = query('Python') # namedtuple is used as a container
>>> response
Response(redirect=u'', definition=u'', image_width=0, ...}
>>> type(response)
<class 'duckduckpy.api.Response'>
>>> response.related_topics[0]
Result(first_url=u'', text=...)
>>> type(response.related_topics[0])
<class 'duckduckpy.api.Result'>

>>> response = query('Python', container='dict') # dict as the container
>>> type(response)
<type 'dict'>
>>> response
{u'abstract': u'', u'results': [], u'image_is_logo': 0, ...}
>>> type(response['related_topics'][0])
<type 'dict'>
>>> response['related_topics'][0]
{u'first_url': u'', u'text': ...}


  • Python 3 support
  • SSL certificate checking
Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
duckduckpy0.1.tar.gz (6.0 kB) Copy SHA256 Checksum SHA256 Source May 12, 2015 (13.6 kB) Copy SHA256 Checksum SHA256 Source May 12, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting