Google LightHouse Data Extractor
Project description
LightHouse Data Extract
This tool parses the google lighthouse json data, accepts a csv file for categories of the URLs and returns 4 pandas DataFrames for metrics, opportunities, diagnostics and resources.
Install
pip install lighthousedataextract
Import
from lighthousedataextract import LightHouseDataExtract
Create a report variable
If json files are in directory ./repprt/lighthouse/ and you don't want to give an input file for categories of URLs
report = LightHouseDataExtract()
If your json files are in another directory
report = LightHouseDataExtract(
path_to_json="./data/lighthouse/report/lighthouse/"
)
If you want to seperate URLs in categories
Your CSV of URLs should have two columns, without headers. Below you can see an example:
https://www.example.com/ | Home Page |
https://www.example.com/categories/category-1 | Middle Tail |
https://www.example.com/products/product-1234 | Long Tail |
report = LightHouseDataExtract(url_category_file="./data/lighthouse/category.csv")
Create a lighthouse metrics DataFrame
from lighthousedataextract import LightHouseDataExtract
report = LightHouseDataExtract(
path_to_json="./data/lighthouse/report/lighthouse/",
url_category_file="./data/lighthouse/category.csv",
)
df_lh_perf_metrics = report.df_lh_perf_metrics()
df_lh_perf_metrics.set_index("url").T
Create other DataFrames
df_opportunities = report.df_opportunities()
display(df_opportunities)
df_diagnostics = report.df_diagnostics()
display(df_diagnostics)
df_resources = report.df_resources()
display(df_resources)
If json files are obtained by gooogle pagespeed insights api then
api_report = LightHouseDataExtract(from_api=True)
Project details
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
Close
Hashes for lighthousedataextract-1.0.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 983ce43e7136ce5a833569626fc1afe8ef6157f28ccce4920fc85f3213a753a2 |
|
MD5 | 4bab484bc5a27cddc3d782cd894f0c5b |
|
BLAKE2b-256 | 78043ed8d17504f34be05d110d3d704b31dc452c2942d30112ed54f14ece505c |
Close
Hashes for lighthousedataextract-1.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6d1cfce7eec67bdb66856d30e35c6784b90429222ec096f9c3103ed47c20d8b |
|
MD5 | 54059f97d95e34528c049b04210064ce |
|
BLAKE2b-256 | 830cdba1aac83c9c7b37e16411652a8395c34c2312a5a4d50d94cc13137b9763 |