Metadata-Version: 2.5
Name: extract-emails
Version: 6.2.0
Summary: Extract email addresses and linkedin profiles from given URL.
Project-URL: repository, https://github.com/dmitriiweb/extract-emails
Project-URL: documentation, https://dmitriiweb.github.io/extract-emails
Author-email: Dmitrii K <dmitriik@proton.me>
License-File: LICENSE
Keywords: email,linkedin,parser
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: Unix
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Utilities
Requires-Python: <3.15,>=3.10
Requires-Dist: aiocsv>=1.4.1
Requires-Dist: aiofiles>=25.1.0
Requires-Dist: click>=8.1
Requires-Dist: loguru>=0.7.3
Requires-Dist: lxml>=6.1.3
Requires-Dist: pydantic>=2.14.1
Provides-Extra: all
Requires-Dist: httpx>=0.28.1; extra == 'all'
Requires-Dist: playwright>=1.64.0; extra == 'all'
Provides-Extra: dev
Requires-Dist: jinja2>=3.1.6; extra == 'dev'
Requires-Dist: lxml-stubs>=0.5.1; extra == 'dev'
Requires-Dist: mkdocs-autorefs>=1.4.4; extra == 'dev'
Requires-Dist: mkdocs-copy-to-llm>=0.2.10; extra == 'dev'
Requires-Dist: mkdocs-material>=9.7.7; extra == 'dev'
Requires-Dist: mkdocs>=1.6.1; extra == 'dev'
Requires-Dist: mkdocstrings[python]>=1.0.6; extra == 'dev'
Requires-Dist: mypy>=2.4.0; extra == 'dev'
Requires-Dist: pygments>=2.21.0; extra == 'dev'
Requires-Dist: pytest-async>=0.1.1; extra == 'dev'
Requires-Dist: pytest-asyncio>=1.4.0; extra == 'dev'
Requires-Dist: pytest-cov>=7.1.0; extra == 'dev'
Requires-Dist: pytest>=9.1.1; extra == 'dev'
Requires-Dist: ruff>=0.17.1; extra == 'dev'
Requires-Dist: tox>=4.65.0; extra == 'dev'
Requires-Dist: types-aiofiles>=25.1.0.20260518; extra == 'dev'
Provides-Extra: httpx
Requires-Dist: httpx>=0.28.1; extra == 'httpx'
Provides-Extra: playwright
Requires-Dist: playwright>=1.64.0; extra == 'playwright'
Description-Content-Type: text/markdown

# Extract Emails

![Image](https://github.com/dmitriiweb/extract-emails/blob/docs_improvements/images/email.png?raw=true)

[![PyPI version](https://badge.fury.io/py/extract-emails.svg)](https://badge.fury.io/py/extract-emails)

Extract emails and linkedins profiles from a given website

[Documentation](https://dmitriiweb.github.io/extract-emails/)

## Requirements

- Python >= 3.10

## Installation

```bash
# Install the backend you need; HTTPX and Playwright are independent extras.
pip install "extract-emails[httpx]"
# Or, for Chromium:
pip install "extract-emails[playwright]"
playwright install chromium --with-deps
# Install both optional backends only if you need both:
pip install "extract-emails[all]"
```

## Quick Usage

### As a library

The HTTPX backend supports synchronous and asynchronous extraction. Substitute a
URL for a site you are authorized to crawl (a local test server is suitable).
Each function owns and closes its browser; call the function you need.

```python
from pathlib import Path

from extract_emails import DefaultWorker
from extract_emails.browsers import HttpxBrowser
from extract_emails.models import PageData


def run_sync(url: str) -> None:
    with HttpxBrowser() as browser:
        worker = DefaultWorker(url, browser)
        data = worker.get_data()
    PageData.to_csv(data, Path("output-sync.csv"))


async def run_async(url: str) -> None:
    async with HttpxBrowser() as browser:
        worker = DefaultWorker(url, browser)
        data = await worker.aget_data()
    await PageData.ato_csv(data, Path("output-async.csv"))


# Call one from your application, for example:
# run_sync("http://127.0.0.1:8000/")
# In an async function: await run_async("http://127.0.0.1:8000/")
```

Install only the browser backend you use: `pip install "extract-emails[httpx]"`
for HTTPX, or `pip install "extract-emails[playwright]"` followed by
`playwright install chromium --with-deps` for Chromium. The extras are
independent; installing one does not install the other. For Chromium, replace
`HttpxBrowser` with `ChromiumBrowser` in the corresponding sync or async
context manager and install the Playwright extra. Install both extras only if
you need both backends. `pip install "extract-emails[all]"` installs all extras.

### As a CLI tool

The CLI defaults to extracting email addresses. You can request both supported
data types with a comma-separated list:

```bash
extract-emails --help
extract-emails --url http://127.0.0.1:8000/ --output-file output.csv \
  --browser-name httpx --data-type email,linkedin
```

`--browser-name` accepts `httpx` or `chromium`; its default is `chromium`.
`--data-type` defaults to `email`; accepted values are `email` and `linkedin`.
The CSV columns include `website` and `page_url` metadata, followed by requested
data columns that are present in the crawl.