{ "info": { "author": "Ivan Kliuk", "author_email": "ivan.kliuk@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Internet :: WWW/HTTP :: Indexing/Search" ], "description": "DuckDuckPy\n==========\n\n|package| |travis-ci| |coveralls|\n\n`DuckDuckPy `_ is a Python\nlibrary for querying `DuckDuckGo API `_ and\nrender results either to Python dictionary or namedtuple.\n\nFeatures\n--------\n\n* Uses standard library only\n* Works on Python 2.6+ and 3.3+\n* Unit test coverage 100%\n* SSL and unicode support\n* Licensed under MIT license\n\nInstallation\n------------\n\nYou can install DuckDuckPy either via the `Python Package Index (PyPI) `_ or\nfrom source.\n\nTo install using ``pip``:\n\n.. code:: bash\n\n $ pip install duckduckpy\n\nTo install using ``easy_install``:\n\n.. code:: bash\n\n $ easy_install duckduckpy\n\nTo install from sources you can download the latest version of DuckDuckPy\neither from `PyPI `_ or\n`GitHub `_, extract archive contents and\nrun following command from the source directory:\n\n.. code:: bash\n\n $ python setup.py install\n\nLatest upstream version can be installed directly from the git repository:\n\n.. code:: bash\n\n $ pip install git+https://github.com/ivankliuk/duckduckpy.git\n\nAPI description\n---------------\n\n.. code-block:: python\n\n query(query_string, secure=False, container=u'namedtuple', verbose=False,\n user_agent=u'duckduckpy 0.2', no_redirect=False, no_html=False,\n skip_disambig=False)\n\nGenerates and sends a query to DuckDuckGo API.\n\n**Arguments:**\n\n+---------------+-------------------------------------------------------------+\n| query_string | Query to be passed to DuckDuckGo API. |\n+---------------+-------------------------------------------------------------+\n| secure | Use secure SSL/TLS connection. Default - False. |\n| | Syntactic sugar is secure_query function which is passed |\n| | the same parameters. |\n+---------------+-------------------------------------------------------------+\n| container | Indicates how dict-like objects are serialized. There are |\n| | two possible options: namedtuple and dict. If 'namedtuple' |\n| | is passed the objects will be serialized to namedtuple |\n| | instance of certain class. If 'dict' is passed the objects |\n| | won't be deserialized. Default value: 'namedtuple'. |\n+---------------+-------------------------------------------------------------+\n| verbose | Don't raise any exception if error occurs. |\n| | Default value: False. |\n+---------------+-------------------------------------------------------------+\n| user_agent | User-Agent header of HTTP requests to DuckDuckGo API. |\n| | Default value: 'duckduckpy 0.2' |\n+---------------+-------------------------------------------------------------+\n| no_redirect | Skip HTTP redirects (for !bang commands). |\n| | Default value: False. |\n+---------------+-------------------------------------------------------------+\n| no_html | Remove HTML from text, e.g. bold and italics. |\n| | Default value: False. |\n+---------------+-------------------------------------------------------------+\n| skip_disambig | Skip disambiguation (D) Type. Default value: False. |\n+---------------+-------------------------------------------------------------+\n\n**Raises:**\n\n+--------------------------+--------------------------------------------------+\n| DuckDuckDeserializeError | JSON serialization failed. |\n+--------------------------+--------------------------------------------------+\n| DuckDuckConnectionError | Something went wrong with httplib operation. |\n+--------------------------+--------------------------------------------------+\n| DuckDuckArgumentError | Passed argument is wrong. |\n+--------------------------+--------------------------------------------------+\n\n**Returns:**\n\nContainer depends on container parameter. Each field in the response is\nconverted to the so-called snake case.\n\nUsage\n-----\n\n.. code-block:: python\n\n >>> from duckduckpy import query\n >>> response = query('Python') # namedtuple is used as a container\n >>> response\n Response(redirect=u'', definition=u'', image_width=0, ...}\n >>> type(response)\n \n >>> response.related_topics[0]\n Result(first_url=u'https://duckduckgo.com/Python', text=...)\n >>> type(response.related_topics[0])\n \n\n >>> response = query('Python', container='dict') # dict as the container\n >>> type(response)\n \n >>> response\n {u'abstract': u'', u'results': [], u'image_is_logo': 0, ...}\n >>> type(response['related_topics'][0])\n \n >>> response['related_topics'][0]\n {u'first_url': u'https://duckduckgo.com/Python', u'text': ...}\n\nTODO\n----\n\n* SSL certificate checking\n\n.. |package| image:: https://badge.fury.io/py/duckduckpy.svg\n :target: http://badge.fury.io/py/duckduckpy\n :alt: PyPI package\n.. |travis-ci| image:: https://travis-ci.org/ivankliuk/duckduckpy.svg?branch=master\n :target: https://travis-ci.org/ivankliuk/duckduckpy\n :alt: CI Status\n.. |coveralls| image:: https://coveralls.io/repos/ivankliuk/duckduckpy/badge.svg?branch=master\n :target: https://coveralls.io/r/ivankliuk/duckduckpy?branch=master\n :alt: Coverage", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/ivankliuk/duckduckpy/tarball/0.2", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ivankliuk/duckduckpy/", "keywords": "duckduckgo", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "duckduckpy", "package_url": "https://pypi.org/project/duckduckpy/", "platform": "any", "project_url": "https://pypi.org/project/duckduckpy/", "project_urls": { "Download": "https://github.com/ivankliuk/duckduckpy/tarball/0.2", "Homepage": "https://github.com/ivankliuk/duckduckpy/" }, "release_url": "https://pypi.org/project/duckduckpy/0.2/", "requires_dist": null, "requires_python": null, "summary": "Library for querying the instant answer API of DuckDuckGo search engine.", "version": "0.2" }, "last_serial": 2473535, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "9b0ac8af2c3e33dcfc4201b392b10458", "sha256": "37572c29e10384656874e035148501477d2179b0914b1906075d0caffe3b7482" }, "downloads": -1, "filename": "duckduckpy0.1.tar.gz", "has_sig": false, "md5_digest": "9b0ac8af2c3e33dcfc4201b392b10458", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5962, "upload_time": "2015-05-12T10:28:25", "url": "https://files.pythonhosted.org/packages/e4/97/e7295644f38886ba5856756be69cd705d17e44a5055f9b27ffee53efb8e2/duckduckpy0.1.tar.gz" }, { "comment_text": "", "digests": { "md5": "4e14088233eda664a434d097661840db", "sha256": "5dd6a76769c3f6167bd9abb6dd156ea4405bbcd0296ed2af04f4adbbf235595d" }, "downloads": -1, "filename": "duckduckpy-0.1.zip", "has_sig": false, "md5_digest": "4e14088233eda664a434d097661840db", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13636, "upload_time": "2015-05-12T10:19:26", "url": "https://files.pythonhosted.org/packages/26/54/90372d98ad25e9944fd00ab8cd1ac0bc524c0058f575a1a8ac866d487942/duckduckpy-0.1.zip" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "09c5e41b1fb5550a4c336242683e4412", "sha256": "608c2972efc375d3af88fef12a182e62bd8e3f971fc1e51877a2f636599e18b8" }, "downloads": -1, "filename": "duckduckpy-0.2.tar.bz2", "has_sig": false, "md5_digest": "09c5e41b1fb5550a4c336242683e4412", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7108, "upload_time": "2016-11-21T12:26:59", "url": "https://files.pythonhosted.org/packages/e0/7a/b186c3e372217edf3573844cdf5d9c22f11d147ec8d46f04982b40b4f4f1/duckduckpy-0.2.tar.bz2" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "09c5e41b1fb5550a4c336242683e4412", "sha256": "608c2972efc375d3af88fef12a182e62bd8e3f971fc1e51877a2f636599e18b8" }, "downloads": -1, "filename": "duckduckpy-0.2.tar.bz2", "has_sig": false, "md5_digest": "09c5e41b1fb5550a4c336242683e4412", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7108, "upload_time": "2016-11-21T12:26:59", "url": "https://files.pythonhosted.org/packages/e0/7a/b186c3e372217edf3573844cdf5d9c22f11d147ec8d46f04982b40b4f4f1/duckduckpy-0.2.tar.bz2" } ] }