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
Get ecoindex
You can easily get the ecoindex by calling the function get_ecoindex()
:
(function) get_ecoindex: (dom: int, size: float, requests: int) -> Coroutine[Any, Any, Ecoindex]
Example:
import asyncio
from pprint import pprint
from ecoindex.compute import get_ecoindex
# Get ecoindex from DOM elements, size of page and requests of the page
ecoindex = asyncio.run(get_ecoindex(dom=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.7.0.tar.gz
(10.4 kB
view details)
Built Distribution
File details
Details for the file ecoindex_compute-5.7.0.tar.gz
.
File metadata
- Download URL: ecoindex_compute-5.7.0.tar.gz
- Upload date:
- Size: 10.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.10.6 Linux/6.2.0-1017-lowlatency
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a22a114c3b019b1e5024afbffa2987c347212bdf6d33bfee26bc8d1e65ddac8 |
|
MD5 | a799e1a085120f0b1e2e260d52646e58 |
|
BLAKE2b-256 | 9f2f2d8af238ff5f21bb641b7b09c5c4795deca4e3c1b44d044e61f1620fbc61 |
File details
Details for the file ecoindex_compute-5.7.0-py3-none-any.whl
.
File metadata
- Download URL: ecoindex_compute-5.7.0-py3-none-any.whl
- Upload date:
- Size: 15.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.10.6 Linux/6.2.0-1017-lowlatency
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e3f08d2c5a334475d651ae6188652f97fd89bffe6e6bfde1d77b8cf6423d696 |
|
MD5 | 9d35cfc0830c543f03a037fdc4df6bbe |
|
BLAKE2b-256 | 9e57532a2c43ab4285b9272723bc20837aa06de0170d96698e31da70e5525f9f |