Checks static .html files for bad links
Project description
existence
=========
Recursively scans directories for static html files for bad or empty links. See
[here](http://www.ericcarmichael.com/writing-my-first-python-package.html) why I wrote this, I hate missing details!
# Example bad or empty links
```html
<a href=""></a> Empty
<a href></a> Empty
<a href="python.org"></a> Any bad link will fail, this one is missing http://
```
# Usage
## Command line
> existence /path/to/dir
Checking links...
57 of 57
All of your links exist!
## Python
```python
>>> from existence import scan
>>> scan("/path/to/dir")
[]
>>> scan("/path/to/an/error")
[('None', '/path/to/an/error/index.html', 121), ('non-existant.html', '/path/to/an/error/other.html', 22)]
# Returns list of tuples: [(url, file_name, line_number)]
```
# Progress bar
To enable the progress bar `pip install progressbar==2.3`
# Running tests
> python -m unittest discover
=========
Recursively scans directories for static html files for bad or empty links. See
[here](http://www.ericcarmichael.com/writing-my-first-python-package.html) why I wrote this, I hate missing details!
# Example bad or empty links
```html
<a href=""></a> Empty
<a href></a> Empty
<a href="python.org"></a> Any bad link will fail, this one is missing http://
```
# Usage
## Command line
> existence /path/to/dir
Checking links...
57 of 57
All of your links exist!
## Python
```python
>>> from existence import scan
>>> scan("/path/to/dir")
[]
>>> scan("/path/to/an/error")
[('None', '/path/to/an/error/index.html', 121), ('non-existant.html', '/path/to/an/error/other.html', 22)]
# Returns list of tuples: [(url, file_name, line_number)]
```
# Progress bar
To enable the progress bar `pip install progressbar==2.3`
# Running tests
> python -m unittest discover
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
existence-0.2.0.zip
(5.6 kB
view details)
File details
Details for the file existence-0.2.0.zip
.
File metadata
- Download URL: existence-0.2.0.zip
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 136b7447ce9ed7b7b69d958cbb7f4d61376491bafe0110024667fa7f035c5937 |
|
MD5 | 766a48c309eda5eb4fe0ed1f9405a034 |
|
BLAKE2b-256 | 8e1f83ba5e3d44ec55c056049ecf474cf27ab69d804cd7bdd96c7b758e158e43 |