Skip to main content

tool to collect and validate urls over static files (code and documentation)

Project description

Build Status Documentation Status codecov Python CodeFactor PyPI Downloads License


This is a python module to collect urls over static files (code and documentation) and then test for and report broken links. If you are interesting in using this as a GitHub action, see urlchecker-action. There are also container bases available on

Module Documentation

A detailed documentation of the code is available under



You can install the urlchecker from pypi:

pip install urlchecker

or install from the repository directly:

git clone
cd urlchecker-python
python install

Installation will place a binary, urlchecker in your Python path.

$ which urlchecker

Check Local Folder

Your most likely use case will be to check a local directory with static files (documentation or code) for files. In this case, you can use urlchecker check:

$ urlchecker check --help

$ urlchecker check --help
usage: urlchecker check [-h] [-b BRANCH] [--subfolder SUBFOLDER] [--cleanup]
                        [--force-pass] [--no-print] [--file-types FILE_TYPES]
                        [--white-listed-urls WHITE_LISTED_URLS]
                        [--white-listed-patterns WHITE_LISTED_PATTERNS]
                        [--white-listed-files WHITE_LISTED_FILES]
                        [--retry-count RETRY_COUNT] [--timeout TIMEOUT]

positional arguments:
  path                  the local path or GitHub repository to clone and check

optional arguments:
  -h, --help            show this help message and exit
  -b BRANCH, --branch BRANCH
                        if cloning, specify a branch to use (defaults to
  --subfolder SUBFOLDER
                        relative subfolder path within path (if not specified,
                        we use root)
  --cleanup             remove root folder after checking (defaults to False,
                        no cleaup)
  --force-pass          force successful pass (return code 0) regardless of
  --no-print            Skip printing results to the screen (defaults to
                        printing to console).
  --file-types FILE_TYPES
                        comma separated list of file extensions to check
                        (defaults to .md,.py)
  --white-listed-urls WHITE_LISTED_URLS
                        comma separated list of white listed urls (no spaces)
  --white-listed-patterns WHITE_LISTED_PATTERNS
                        comma separated list of white listed patterns for urls
                        (no spaces)
  --white-listed-files WHITE_LISTED_FILES
                        comma separated list of white listed files and
                        patterns for files (no spaces)
  --retry-count RETRY_COUNT
                        retry count upon failure (defaults to 2, one retry).
  --timeout TIMEOUT     timeout (seconds) to provide to the requests library
                        (defaults to 5)

You have a lot of flexibility to define patterns of urls or files to skip, along with the number of retries or timeout (seconds). The most basic usage will check an entire directory. Let's clone and check the directory of one of the maintainers:

git clone
urlchecker check .

$ urlchecker check .
  original path: .
     final path: /tmp/
      subfolder: None
         branch: master
        cleanup: False
     file types: ['.md', '.py']
      print all: True
 url whitetlist: []
   url patterns: []
  file patterns: []
     force pass: False
    retry count: 2
        timeout: 5


No urls found.

Done. All URLS passed.

Check GitHub Repository

But wouldn't it be easier to not have to clone the repository first? Of course! We can specify a GitHub url instead, and add --cleanup if we want to clean up the folder after.

urlchecker check

If you specify any arguments for a white list (or any kind of expected list) make sure that you provide a comma separated list without any spaces

urlchecker check,_config.yml

Save Results

If you want to save your results to file, perhaps for some kind of record or other data analysis, you can provide the --save argument:

$ urlchecker check --save results.csv .
  original path: .
     final path: /home/vanessa/Desktop/Code/urlstechie/urlchecker-test-repo
      subfolder: None
         branch: master
        cleanup: False
     file types: ['.md', '.py']
      print all: True
 url whitetlist: []
   url patterns: []
  file patterns: []
     force pass: False
    retry count: 2
           save: results.csv
        timeout: 5

No urls found.



Saving results to /home/vanessa/Desktop/Code/urlstechie/urlchecker-test-repo/results.csv

Done. All URLS passed.

The file that you save to will include a comma separated value tabular listing of the urls, and their result. The result options are "passed" and "failed" and the default header is URL,RESULT. All of these defaults are exposed if you want to change them (e.g., using a tab separator or a different header) if you call the function from within Python. Here is an example of the default file produced, which should satisfy most use cases:


If you have any questions, please don't hesitate to open an issue.


A Docker container is provided if you want to build a base container with urlchecker, meaning that you don't need to install it on your host. You can build the container as follows:

docker build -t urlchecker .

And then the entrypoint will expose the urlchecker.

docker run -it urlschecker



The module is organized as follows:

├── client              # command line client
├── main                # functions for supported integrations (e.g., GitHub)
├── core                # core file and url processing tools
└──          # package and versioning

In the "client" folder, for example, the commands that are exposed for the client (e.g., check) would named accordingly, e.g., client/ Functions for Github are be provided in main/ This organization should be fairly straight forward to always find what you are looking for.


If you need help, or want to suggest a project for the organization, please open an issue

Project details

Download files

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

Files for urlchecker, version 0.0.13
Filename, size File type Python version Upload date Hashes
Filename, size urlchecker-0.0.13.tar.gz (20.3 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page