Removes dead & duplicate links from markdown files and updates redirects.
Project description
link-reaper
Verifies AND automatically reaps links to keep your lists updated and clean of "zombies".
Unlike other link verifiers, this one will make direct changes to your markdown files instead of just preventing push/pull requests.
Installation
For personal usage
Here are a couple options for those who simply want to use the project.
As an installed Package:
TBD - for directly downloading the package folder
Using Pip Install:
- Have Python installed and the latest version of Pip
- Use
pip install the-link-reaper - See here for what you can do with this package.
For Developers
Instructions
- Have Python installed.
- Fork this repo (if you want to contribute. If not, skip this step)
- Find/create your directory of choice
- Open a terminal in that directory and use
git clone https://github.com/<your name>/<your fork name here>.gitbut if you are not using a fork, just usehttps://github.com/sharktrexer/link-reaper.git - Create a virtual environment
python3 -m venv venv - Install requried dependencies
pip install -r requirements.txtor if you intend to contribute,pip install -r requirements_dev.txt - Use
python -m link_reaper.reaper reap yourfile.mdutilizing the many options here to test or play around with the project. - If your contributing, follow the steps below
Contributing
Feel free to create Issues or Pull Requests at your leisure. If you are unsure if the PR is a good idea, create an Issue first and I will respond as best as I can.
Before creating a pull request, be sure to use the following commands after implementing your changes (and make sure you installed dependencies from dev_requirements.txt):
# Lint code
ruff check link-reaper
# Apply lint fixes (you may have to do some manually)
ruff check --fix
# Format changes
ruff format link-reaper
# Optional for bonus points
pylint link-reaper
If you don't use the ruff commands, the workflow of this project will fail and it will take longer to merge your potentially beautiful changes!
Usage
Here are the many ways you can utilize this python package.
Terminal
Package Usage: python -m link_reaper.reaper reap [OPTIONS] [FILES]...
Regular Usage: link-reaper reap [OPTIONS] [FILES]...
Command that reaps links from markdown files based on your options
Options:
-s, --show_afterlife Create an afterlife-filename.md for each
checked file that only contains the reaped
links.
-m, --merciful Instead of overwriting files, create a reaped-
filename.md for each checked file that contains
applied changes.
-ig, --ignore_ghosts Prevents updating redirecting links.
-id, --ignore_doppelgangers Ignore duplicate links.
-is, --ignore_ssl Disable SSL errors. Not very secure so use with
caution.
-it, --ignore_timeouts Ignore links that time out.
-iu, --ignore_urls TEXT Ignores specific links you want to whitelist.
Enter each url comma separated.
-rs, --reap_status TEXT Status codes you want to be reaped (By default
404, 500, 521 are reaped and 300s are updated).
Enter each code comma separated.
-p, --patience INTEGER Max # of seconds to wait for url to send data
until it times out.
-dl, --disable_logging Prevents creation of any log type files (does
not overwrite -show-afterlife)
-v, --verbose Provide more information on the reaping
process.
--help Show this message and exit.
Examples
TODO
GitHub Actions
GitHub Action functionality currently in production.
Docker
Docker functionality in progress.
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 the_link_reaper-0.8.1.tar.gz.
File metadata
- Download URL: the_link_reaper-0.8.1.tar.gz
- Upload date:
- Size: 12.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e829541ba2e2eff246bc0b83f5594052d9743bd84b8decf7a9c21298bcf2c3a6
|
|
| MD5 |
5bfcb66b5454926e277fd3279626d05a
|
|
| BLAKE2b-256 |
f5e626ebaab5c72c720b56add046df1eb531490b8338c3a87b0650f467e32336
|
File details
Details for the file the_link_reaper-0.8.1-py3-none-any.whl.
File metadata
- Download URL: the_link_reaper-0.8.1-py3-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bde75576877fa5d2251a47216bd957308f6ac864b75599b4fa2f83ffb96bf429
|
|
| MD5 |
4a2b43ae3a91fe9e2a027670168ffcd2
|
|
| BLAKE2b-256 |
f4a706152a3a89fe719b1419cb51fe684518cda276bfa6c63d2fabd9bb49aa82
|