Skip to main content

A simple module for searching on DuckDuckGo

Project description

DuckPy
A simple Python module for searching on DuckDuckGo.

Installation

Duckpy can be installed using pip with this command:

pip install -U duckpy

Alternatively, you can install directly from git:

pip install -U git+https://github.com/AmanoTeam/duckpy

Usage:

To use duckpy is easy, let's see some examples:

First example:

from duckpy import Client

client = Client()

results = client.search("Amano Team duckpy")

# Prints first result title
print(results[0]["title"])

# Prints first result URL
print(results[0]["url"])

# Prints first result description
print(results[0]["description"])

We also provide an asynchronous version:

import asyncio
from duckpy.aio import Client

client = Client()

async def get_results():
  results = await client.search("Amano Team duckpy")

  # Prints first result title
  print(results[0]["title"])

  # Prints first result URL
  print(results[0]["url"])

  # Prints first result description
  print(results[0]["description"])


loop = asyncio.get_event_loop()
loop.run_until_complete(get_results())

The result:

GitHub - AmanoTeam/duckpy: 🦆 A simple Python module for ...
https://github.com/AmanoTeam/duckpy
🦆 A simple Python module for searching 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 in 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://98.76.54.32:443'])

If you pass more than one proxy, them will be randomly chosen every time you use the .search() method.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

duckpy-2.1.0.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

duckpy-2.1.0-py2.py3-none-any.whl (3.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file duckpy-2.1.0.tar.gz.

File metadata

  • Download URL: duckpy-2.1.0.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.8.0

File hashes

Hashes for duckpy-2.1.0.tar.gz
Algorithm Hash digest
SHA256 e160b6005dbc57636692a0c2a1c2268ced5ee7cd8afc185b81874c72cfa1ab82
MD5 867dc04969ab7f437a9ba3c5d7364620
BLAKE2b-256 a5582110b79889d004c5e47a358e3e892928c4fccdfcc2344c7753a4596aa728

See more details on using hashes here.

File details

Details for the file duckpy-2.1.0-py2.py3-none-any.whl.

File metadata

  • Download URL: duckpy-2.1.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.8.0

File hashes

Hashes for duckpy-2.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 091e9ee1815df424590c4a21c490a60bb4d8a1835a1dab975dbe3ed2e7b1657a
MD5 93ee1b890755ae1a6b15f48f7e7f5ab6
BLAKE2b-256 71eb4c284edf6dd62b66eede025a6fa2c91be99a2ab99e3f28cf4915743cd262

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page