Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/anand2312/pyquack

Simple Python sync/async duckduckgo API wrapper.
https://github.com/anand2312/pyquack

api async asyncio duckduckgo duckduckgo-api python requests

Last synced: about 1 month ago
JSON representation

Simple Python sync/async duckduckgo API wrapper.

Awesome Lists containing this project

README

        

# pyquack
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

Simple Python sync/async duckduckgo API wrapper.

[Documentation](https://pyquack.anand2312.tech)

## Quickstart

Synchronous:
```py
import pyquack

client = pyquack.Client()

response = client.query("DuckDuckGo")

print(response.results)
print(response.definition)
```

Async:
```py
import asyncio

import pyquack

async def main() -> None:
client = pyquack.AsyncClient()

response = await client.query("DuckDuckGo")

print(response.results)
print(response.definition)

asyncio.run(main())
```