Skip to main content

DuckDuckGo Plugin

from ovos_ddg_solver import DuckDuckGoSolver

d = DuckDuckGoSolver()

ans = d.spoken_answer("Quem foi Bartolomeu Dias", lang="pt")
print(ans)
# Bartolomeu Dias, OM, OMP foi um navegador português que ficou célebre por ter sido o primeiro europeu a navegar para além do extremo sul da África, contornando o Cabo da Boa Esperança e chegando ao Oceano Índico a partir do Atlântico, abrindo o caminho marítimo para a Índia. Dele não se conhecem os antepassados, mas mercês e armas a ele outorgadas passaram a seus descendentes. Seu irmão foi Diogo Dias, também experiente navegador. Foi o principal navegador da esquadra de Pedro Álvares Cabral em 1500. As terras do Brasil, até então desconhecidas pelos portugueses, confundiram os navegadores, que pensaram tratar-se de uma ilha, a que deram o nome de "Vera Cruz".

info = d.get_infobox("Stephen Hawking", lang="pt")[0]
from pprint import pprint

pprint(info)
# {'born': 'Quinta-feira, oito de Janeiro, mil novecentos e quarenta e dois',
#  'died': 'Quarta-feira, catorze de Março, dois mil e dezoito',
#  'facebook profile': 'stephenhawking',
#  'imdb id': 'nm0370071',
#  'instance of': {'entity-type': 'item', 'id': 'Q5', 'numeric-id': 5},
#  'official website': 'https://hawking.org.uk',
#  'rotten tomatoes id': 'celebrity/stephen_hawking',
#  'wikidata aliases': ['Stephen Hawking',
#                       'Hawking',
#                       'Stephen William Hawking',
#                       'S. W. Hawking'],
#  'wikidata description': 'físico teórico, cosmólogo e autor inglês (1942–2018)',
#  'wikidata id': 'Q17714',
#  'wikidata label': 'Stephen Hawking',
#  'youtube channel': 'UCPyd4mR0p8zHd8Z0HvHc0fw'}


# chunked answer, "tell me more"
for sentence in d.long_answer("who is Isaac Newton", lang="en"):
    print(sentence["title"])
    print(sentence["summary"])
    print(sentence.get("img"))

    # who is Isaac Newton
    # Sir Isaac Newton was an English polymath active as a mathematician, physicist, astronomer, alchemist, theologian, author, and inventor.
    # https://duckduckgo.com/i/401ff0bf4dfa0847.jpg

    # who is Isaac Newton
    # He was a key figure in the Scientific Revolution and the Enlightenment that followed.
    # https://duckduckgo.com/i/401ff0bf4dfa0847.jpg

    # who is Isaac Newton
    # His book Philosophiæ Naturalis Principia Mathematica, first published in 1687, achieved the first great unification in physics and established classical mechanics.
    # https://duckduckgo.com/i/401ff0bf4dfa0847.jpg

    # who is Isaac Newton
    # Newton also made seminal contributions to optics, and shares credit with German mathematician Gottfried Wilhelm Leibniz for formulating infinitesimal calculus, though he developed calculus years before Leibniz.
    # https://duckduckgo.com/i/401ff0bf4dfa0847.jpg

    # who is Isaac Newton
    # Newton contributed to and refined the scientific method, and his work is considered the most influential in bringing forth modern science.
    # https://duckduckgo.com/i/401ff0bf4dfa0847.jpg

    # who is Isaac Newton
    # In the Principia, Newton formulated the laws of motion and universal gravitation that formed the dominant scientific viewpoint for centuries until it was superseded by the theory of relativity.
    # https://duckduckgo.com/i/401ff0bf4dfa0847.jpg

Metadata

Release files for ovos-ddg-solver-plugin 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ovos-ddg-solver-plugin 0.0.1
File Size Uploaded
ovos_ddg_solver_plugin-0.0.1.tar.gz 23.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ovos-ddg-solver-plugin 0.0.1
File Interpreter ABI Platform
ovos_ddg_solver_plugin-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 79.1 kB

Release files / ovos_ddg_solver_plugin-0.0.1.tar.gz

Download URL ovos_ddg_solver_plugin-0.0.1.tar.gz
Size 23.4 kB
Tags Source
SHA-256 checksum
How to use checksums
8f7bdb7917f0194abb662e26b715e38c0b2ac2f74f2aa9dbf2b515fefa6d3363
BLAKE2b-256 checksum
How to use checksums
e0b525b5598b8ac0b483d7eb9d5dff0946330c7088eda0de980efa8ad3fc448e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / ovos_ddg_solver_plugin-0.0.1-py3-none-any.whl

Download URL ovos_ddg_solver_plugin-0.0.1-py3-none-any.whl
Size 55.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
47d18a8fa756bb073c5b3036196a02f0ac845689353f34dd3073a71c160d3269
BLAKE2b-256 checksum
How to use checksums
79fe49342553260fd91bd7ac950968d70b9838fec70b838aacaad644ede484e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page