Skip to content

Commit

Permalink
added: Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
adamcupial committed Feb 5, 2019
1 parent eb60c75 commit 8c3c793
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions README.md
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

0 comments on commit 8c3c793

Please sign in to comment.