A simple Python module that searches on DuckDuckGo.
Installation:
Duckpy can be installed using pip from PyPI or from GitHub
via PyPI using pip:
pip install -U duckpy
via GitHub using pip+git:
pip install -U git+https://github.com/AmanoTeam/duckpy
Usage:
To use duckpy is easy, let's see some examples:
First example (normal version):
import duckpy
client = duckpy.Client()
search = client.search("Amano Team duckpy")
# Prints first result title
print(search[0]["title"])
# Prints first result URL
print(search[0]["url"])
# Prints first result description
print(search[0]["description"])
The result:
GitHub - AmanoTeam/duckpy: A simple Python module that ...
https://github.com/AmanoTeam/duckpy
A simple Python module that searches on DuckDuckGo - AmanoTeam/duckpy
First example (asyncio version):
import asyncio
import duckpy.aio
client = duckpy.aio.Client()
async def get_results():
search = await client.search("Amano Team duckpy")
# Prints first result title
print(search[0]["title"])
# Prints first result URL
print(search[0]["url"])
# Prints first result description
print(search[0]["description"])
loop = asyncio.get_event_loop()
loop.run_until_complete(get_results())
The result:
GitHub - AmanoTeam/duckpy: A simple Python module that ...
https://github.com/AmanoTeam/duckpy
A simple Python module that searches on DuckDuckGo - AmanoTeam/duckpy
Advanced usage:
You can also set up proxies and/or enable or disable random User-Agents depending on your needs.
Setting up proxies:
You can pass a list with proxies on the Client object, then duckpy will use these proxies to make requests.
Example:
import duckpy
client = duckpy.Client(proxies=['http://123.45.67.89:80', 'https://123.45.67.89:443'])
If you pass more than one proxy, them will be randomly chosen every time you use the .search() method.
Metadata
Release files for duckpy 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| duckpy-2.0.0.tar.gz | 2.7 kB | Details |
Release files / duckpy-2.0.0.tar.gz
| Download URL | duckpy-2.0.0.tar.gz |
|---|---|
| Size | 2.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f0a41f914d8eb9c0b99c4bdf34ba171303ff6e2b4cbe60b12c3c4a37e0f4c700
|
|
BLAKE2b-256 checksum How to use checksums |
56ef43f909e83b98e0d55a59190e0809f7054e48563c2a82923cd97bdf4a3ece
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3
|