Ecoindex module provides a simple way to measure the Ecoindex score based on the 3 parameters: The DOM elements of the page, the size of the page and the number of external requests of the page
Project description
Ecoindex python
This basic module provides a simple interface to get the Ecoindex based on 3 parameters:
- The number of DOM elements in the page
- The size of the page
- The number of external requests of the page
Requirements
- Python ^3.10 with pip
Install
pip install ecoindex_compute
Use
Compute ecoindex
You can easily compute the ecoindex by calling the function compute_ecoindex()
:
(function) compute_ecoindex: (dom: int, size: float, requests: int) -> Coroutine[Any, Any, Ecoindex]
Example:
import asyncio
from pprint import pprint
from ecoindex.compute import compute_ecoindex
# Get ecoindex from DOM elements, size of page and requests of the page
ecoindex = asyncio.run(compute_ecoindex(nodes=100, size=100, requests=100))
pprint(ecoindex)
Result example:
Ecoindex(grade='B', score=72.0, ges=1.56, water=2.34, ecoindex_version='3.0.0')
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
ecoindex_compute-5.8.0.tar.gz
(7.2 kB
view hashes)
Built Distribution
Close
Hashes for ecoindex_compute-5.8.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a6f67a4d059e462ae5322170034603a901e69c0133179982beca093b3d361f5 |
|
MD5 | 6113b12731c4d08c40e89dc528ad62da |
|
BLAKE2b-256 | 6e6b9d1e8d2966cab33726be2d8c8194f21f4fdddca13df466c27ecbdde9ea8a |