Skip to main content

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).

Build Status codecov Code style: black Documentation Status License: MIT

PyPI - Latest Version PyPI - Python Version PyPI - Downloads Monthly PyPI - Downloads Daily

Inspired by the library with a similar name.

Installation:

via pip

pip install python-gtmetrix2

manual

  • Clone or download and extract the repository

  • Copy the src/python-gtmetrix2 directory to your project directory

Usage:

Simplest example:

import json
import python_gtmetrix2

api_key = "e8ddc55d93eb0e8281b255ea236dcc4f"    # your API key
url = "http://example.com"                      # URL to test

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

Versioning:

This project follows semver versioning scheme. Note that according to the semver, as long as the version number starts with 0, no guarantees regarding compatibility are given. Hence, when anyone starts using this library, please let the author know about it, so we can bump version number to one and “freeze” API compatibility.

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

python-gtmetrix2-0.3.1.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_gtmetrix2-0.3.1-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

Details for the file python-gtmetrix2-0.3.1.tar.gz.

File metadata

  • Download URL: python-gtmetrix2-0.3.1.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.1

File hashes

Hashes for python-gtmetrix2-0.3.1.tar.gz
Algorithm Hash digest
SHA256 001489c5459f15dac2ac694822e99eb07d0702583146e8ae39a0211fdafddec1
MD5 1c54ba80e8686b2978bfc5a4bb6044b5
BLAKE2b-256 59d6d90cfdfcdda9491ae44b7ea86a780221337891f1ba1f505607a53bf594c7

See more details on using hashes here.

File details

Details for the file python_gtmetrix2-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: python_gtmetrix2-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 13.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.1

File hashes

Hashes for python_gtmetrix2-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dd8fbfd3ce47b73576cfe2a2027c38d8eb5256af37a58bb0287792b92820b02d
MD5 bb3281f735b6d0c16c2555d12e82d43d
BLAKE2b-256 aad786afffb52488ec60b6b9b508680708b4930b35f87df215a5c13d78cd2f5e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page