-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eb60c75
commit 8c3c793
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Lighthouse runner for python | ||
|
||
## Description | ||
This library is a simple wrapper around lighthouse-cli runner that runs the audit and parses a result in friendly manner. | ||
|
||
## Installation | ||
```bash | ||
pip install git+https://github.com/adamcupial/lighthouse-python.git#egg=lighthouse | ||
``` | ||
|
||
## Usage | ||
|
||
```python | ||
from lighthouse import LighthouseRunner | ||
|
||
report = LighthouseRunner('https://webdesign-log.pl', form_factor='desktop', quiet=False).report | ||
assert report.score['performance'] > 0.5 | ||
print(report.audits['performance'].failed) | ||
``` | ||
|
||
report has 3 properties: | ||
|
||
- score: returns dict where keys are categories and values are scores (0 to 1) | ||
- timings: returns dict where keys are timings and values are timedelta objects | ||
- audits: dict where keys are categories and values are objects with passed and failed lists attached | ||
|
||
## Dependencies | ||
- python 2.7+ | ||
- lighthouse installed |