File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ # Lighthouse runner for python
2+
3+ ## Description
4+ This library is a simple wrapper around lighthouse-cli runner that runs the audit and parses a result in friendly manner.
5+
6+ ## Installation
7+ ``` bash
8+ pip install git+https://github.com/adamcupial/lighthouse-python.git#egg=lighthouse
9+ ```
10+
11+ ## Usage
12+
13+ ``` python
14+ from lighthouse import LighthouseRunner
15+
16+ report = LighthouseRunner(' https://webdesign-log.pl' , form_factor = ' desktop' , quiet = False ).report
17+ assert report.score[' performance' ] > 0.5
18+ print (report.audits[' performance' ].failed)
19+ ```
20+
21+ report has 3 properties:
22+
23+ - score: returns dict where keys are categories and values are scores (0 to 1)
24+ - timings: returns dict where keys are timings and values are timedelta objects
25+ - audits: dict where keys are categories and values are objects with passed and failed lists attached
26+
27+ ## Dependencies
28+ - python 2.7+
29+ - lighthouse installed
You can’t perform that action at this time.
0 commit comments