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
TIMINGS = [
'speed-index'
]
report = LighthouseRunner('https://github.com/adamcupial', form_factor='desktop', quiet=False, timings=TIMINGS).report
assert report.score['performance'] > 0.5
print(report.audits(0.5)['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
Metadata
Release files for lighthouse-python-plus 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| lighthouse_python_plus-1.2.0.tar.gz | 6.9 kB | Without provenance | Details for lighthouse_python_plus-1.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lighthouse_python_plus-1.2.0-py3-none-any.whl | Python 3 | none | any | Details for lighthouse_python_plus-1.2.0-py3-none-any.whl |
Total release size: 14.6 kB
Release files / lighthouse_python_plus-1.2.0.tar.gz
| Download URL | lighthouse_python_plus-1.2.0.tar.gz |
|---|---|
| Size | 6.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f2f4f607a6d5cdee8782f00e6a42afe2809e864d660e3a0a87a4dfb96e774c0e
|
|
BLAKE2b-256 checksum How to use checksums |
7fc886af2112c4b0db202f76d1f1f1d99d902d784202cc07c5ada5d8767fb005
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Release files / lighthouse_python_plus-1.2.0-py3-none-any.whl
| Download URL | lighthouse_python_plus-1.2.0-py3-none-any.whl |
|---|---|
| Size | 7.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3de639bf383e9cba8373c252c1fbf6a07dded9ae359fc764b58a348bbe028721
|
|
BLAKE2b-256 checksum How to use checksums |
de3c896e55618d1047fa62eaff89e437d6df8497f9fcea043ba83a02da38c3a7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Security for lighthouse-python-plus 1.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.