CLI + API for Google PageSpeed Insights
Project description
PyPSI
CLI 🖥 + API for Google PageSpeed Insights
Installation
pip install PythonPSI
Usage
psi <SITE_URL> <OPTION1> <OPTION2> ...
Example:
psi google.com --category seo --stratergy desktop --locale en
CLI
$ psi --help
Usage: psi [OPTIONS] URL
Options:
--api_key TEXT Required to use the API in an automated way and make
multiple requests per second
--category TEXT A Lighthouse category to run; if none are given, only
Performance category will be run
--locale TEXT The locale used to localize formatted results
--stratergy TEXT The analysis strategy (desktop or mobile) to use, and
desktop is the default
--threshold TEXT Threshold score to pass the PageSpeed test. Useful for
setting a performance budget.
--links TEXT If passed adds links with more info about
opportunities. Useful for checking documentation about
opportunities.
--utm_campaign TEXT Campaign name for analytics.
--utm_source TEXT Campaign source for analytics.
--captcha_token TEXT The captcha token passed when filling out a captcha.
--help Show this message and exit.
API Usage
from PythonPSI.api import PSI
PSI('google.com', category='seo', locale='en', stratergy='desktop')
# Returns JSON output
-
PSI
- Required arguments: 1, Optional arguments: 9URL
:- Required
- Default: None
api_key
:- Optional
- Default: None
category
:- Optional
- Default: performance
- Options:
accessibility
,best_practices
,performance
,pwa
,seo
locale
:- Optional
- Default: en
stratergy
:- Optional
- Default: desktop
- Options:
desktop
,mobile
threshold
:- Optional
- Default: None
- Options:
INT
0-100
links
:- Optional
- Default: false
- Options:
true
,false
utm_campaign
:- optional
- Default: None
utm_source
:- Optional
- Default: None
captcha_token
:- Optional
- Default: None
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
PythonPSI-1.6.0.tar.gz
(3.7 kB
view hashes)
Built Distribution
Close
Hashes for PythonPSI-1.6.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 650b9c0a2f0e855e58e6141e5f863edfc91c7c312d3e838fb6a0d659cede9f88 |
|
MD5 | d8406713f3103a1a5c91948885ecc7ae |
|
BLAKE2b-256 | 045fa468f6a2e9d178b14461f36b802f35653f972ae45df477500d207ab91529 |