A Python client library for GTmetrix REST API v2.0
Project description
python-gtmetrix2 is a Python client library for GTmetrix REST API v2.0 (hence 2 in the name).
Inspired by the library with a similar name.
Installation:
via pip
pip install python-gtmetrix2
file copy
This library has zero dependencies and is contained within a single file, so you can just save this file as python_gtmetrix2.py in your project directory and import it
Usage:
Simplest example:
import json
import python_gtmetrix2
api_key = "e8ddc55d93eb0e8281b255ea236dcc4f" # your API key
account = python_gtmetrix2.Account(api_key) # init
test = account.start_test(url) # start test
test.fetch(wait_for_completion=True) # wait for it to finish
report = test.getreport() # get test result
print(json.dumps(report, indent=2)) # do something useful with it
For a wordy introduction into this library, or a more technical explanation, dive into the docs
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
python-gtmetrix2-0.1.2.tar.gz
(13.0 kB
view hashes)
Built Distribution
Close
Hashes for python_gtmetrix2-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1b2aed2fc85f1287763174fc098f10b626f3b7bbd0e3c041763258f79e430b0 |
|
MD5 | 4ef1f9aa7aa8e3f1e4ecf7d0037281ea |
|
BLAKE2b-256 | 96a6eb7d699ab60c4f23f4f9f3ee1f2dfb9209f61ae92f93809f86b742304d74 |