Lighthouse runner is a Python package that wraps the Lighthouse tool for easy integration into Python projects.
Project description
Lighthouse runner for python
About This Repository
This repository is based on the original work of Adam Cupiał and was forked from his lighthouse-python repository. While the original repository had not been updated in five years, I found it to be a valuable resource and decided to update it (I have made some changes, fixed some bugs) and turn it into a package for PyPI. I want to acknowledge the original author for creating the foundation of this project and making it available to the community.
Description
This library is a simple wrapper around lighthouse-cli runner that runs the audit and parses a result in friendly manner.
Installation
if lighthouse is not installed:
npm install -g lighthouse
pip install lighthouse-python-plus
Usage
from lighthouse import LighthouseRunner
report = LighthouseRunner('https://github.com/adamcupial', 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
To see all the usage examples of this library, please check out the demo folder.
Dependencies
- python 3.6+
- node package lighthouse>=10.3.0 installed
Changes
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
Built Distribution
Hashes for lighthouse_python_plus-1.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4250daccd4bc3873802424a6474c53ce2a5e1deadd9522a798cc93205e93b17 |
|
MD5 | e4a1e34c25cb182b63aeb34c9c8e3889 |
|
BLAKE2b-256 | ba34563be9f56a8b95e014a66edefb049c7c68e14aaa2b8c67ae6c0c8abbc5e6 |
Hashes for lighthouse_python_plus-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8eef25cfafb10f9606f19529159a03fe907027c373b98afd6ab16ea12bfb8a53 |
|
MD5 | 7760d33ef0b53c3f50f370ef2f824993 |
|
BLAKE2b-256 | 08dd15876a642e0bdb2a85c2f95e7ccfe8e553e4b61c8a532f88bc8034d3785f |