Metadata-Version: 2.1
Name: ddg-scraper
Version: 1.2
Summary: Easy to use asynchronous and synchronous DuckDuckGo search engine scraper.
Home-page: https://github.com/m-y-x-i/duckduckgo-scraper
Author: Myxi
Author-email: myxi@duck.com
License: GNU GPLv3
Platform: UNKNOWN
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE


# Asynchronous and Synchronous DuckDuckGo Search Engine Scraper

Scrapes the [duckduckgo](https://duck.com) search engine.

# Asynchronous Example
```py
from ddg_scraper import asearch
import asyncio


async def main():
    results = await asearch("Python")
    async for result in results:
        ...

asyncio.run(main())
```

# Synchronous Example
```py
from ddg_scraper import search


results = search("Python")
for result in results:
    ...
```

In both examples, `result` is [`ddg_scraper.Result`](ddg_scraper/_dataclasses.py)

# Attributes and Methods of [`ddg_scraper.Result`](ddg_scraper/_dataclasses.py)

Attributes

- `title`
- `description`
- `url`
- `icon_url`

Methods

- `as_dict()`
    - Converts the dataclass to a `dict` object and returns it.

# How To Install

- **Using pip:** `pip install ddg-scraper`
- **Manual:**
  - Clone the folder somewhere
  - CD to the location
  - Install the packages listed in [`requirements.txt`](/requirements.txt) (`pip install -r requirements.txt`)
  - Copy the folder, [ddg_scraper](/ddg_scraper) where you want to use it.


