Extract hyperlinks and their labels from .docx, .odt, .html, and .pdf documents.
Project description
# extract-links
**extract-links** is a command-line tool for extracting text-label + hyperlink pairs from .docx, .odt, .html, and .pdf files.
- PDF support includes intelligent bounding-box text parsing
- Outputs formats: txt, csv, md, json, xlsx
- Optional deduplication and sorting
- Works across Windows, Linux, macOS
## Install
Clone and install locally:
pip install .
Or use the CLI directly from source:
python -m extract\\\_links.cli \\\[file]
**Usage**
extract-links input.docx -o output --format csv --dedupe --sort
**Arguments**
| Flag | Description |
| ---------- | --------------------------------------------- |
| `input` | Input file (`.docx`, `.odt`, `.html`, `.pdf`) |
| `-o` | Output file prefix (no extension) |
| `--format` | `txt`, `csv`, `md`, `json`, `xlsx` |
| `--dedupe` | Deduplicate URLs |
| `--sort` | Sort by label |
**Example**
extract-links report.pdf -o links --format xlsx --dedupe --sort
**Output Example**
CSV
Text,URL
Project Plan,https://example.com/plan
Resources,https://example.com/resources
**Markdown**
\[Project Plan](https://example.com/plan)
**Supported Formats**
.docx → via python-docx
.odt → via odfpy
.html → via BeautifulSoup
.pdf → via PyMuPDF (bounding box + OCR-style matching)
## Windows Standalone `.exe`
For Windows users without Python, download the `.exe` from the [Releases](https://github.com/pqexpert/extract-links/releases) page.
### Example:
```powershell
extract-links.exe project_plan.docx -o pp_links_out --format csv
### Notes for `.exe` usage:
Place `extract-links.exe` in the same folder as your input file
Or provide the full path to your input file when running
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hyperlink_extractor_jda-1.3.0.tar.gz.
File metadata
- Download URL: hyperlink_extractor_jda-1.3.0.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ae067ea9978c6e6d10b432b98a72c42503b3cad219ea4a4a9b5e5e6ca200539
|
|
| MD5 |
f84ceaf908d35ddbf6f420ae830eeb97
|
|
| BLAKE2b-256 |
9b82d26d4a4910b68ef27ccd2d58e28c0b1ba9e90b1fa67f47ccae545f879519
|
File details
Details for the file hyperlink_extractor_jda-1.3.0-py3-none-any.whl.
File metadata
- Download URL: hyperlink_extractor_jda-1.3.0-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29560295d29c180092fc282294d59778535ece2c6d038e28600b5bc655ba6275
|
|
| MD5 |
84cfabeda5637a8a02ba4554123ed263
|
|
| BLAKE2b-256 |
dabd76219156c2d7b45854a9a0700014eff9d80c0d492f49a241610bb40672da
|