Skip to main content

Checks static .html files for bad links

Project description

existence

Recursively scans directories for static html files for bad or empty links. See here why I wrote this, I hate missing details!

Example bad or empty links

<a href=""></a>            Empty
<a href></a>               Empty
<a href="python.org"></a>  Any bad link will fail, this one is missing http://

Command line

$ existence /path/to/working/links
Checking links...
57 of 57
All of your links exist!

$ existence /path/to/bad/links
Checking links...
23 of 23
Broken links:
    /path/to/bad/links/index.html@121 'None'
    /path/to/bad/links/other.html@22 'non-existant.html'

Python

>>> from existence import scan
>>> scan("/path/to/working/links")
[]
>>> scan("/path/to/bad/links")
[
    ('None', '/path/to/bad/links/index.html', 121),
    ('non-existant.html', '/path/to/bad/links/other.html', 22)
]
# Returns a list of bad url tuples: [(url, file_name, line_number)]

Progress bar

To enable the progress bar pip install progressbar==2.3

Running tests

> python -m unittest discover

Deploying new release

$ python setup.py sdist
$ ```

Project details


Download files

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

Source Distribution

existence-0.3.0.tar.gz (3.5 kB view details)

Uploaded Source

File details

Details for the file existence-0.3.0.tar.gz.

File metadata

  • Download URL: existence-0.3.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for existence-0.3.0.tar.gz
Algorithm Hash digest
SHA256 62e4f50e246a44cd26be73010ffec7c9c30c25cd849af95679c7a2948f0be81b
MD5 673554c6dbe2463d792a25099b0247d8
BLAKE2b-256 0852097346f068d7fc239dc83b442933eb97bcbebd8e945860324486c9fce189

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page