Skip to main content

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

Validate project quality PyPI - Version PyPI - Downloads

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


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.9.0.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

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

ecoindex_compute-5.9.0-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file ecoindex_compute-5.9.0.tar.gz.

File metadata

  • Download URL: ecoindex_compute-5.9.0.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.10.17 Linux/6.8.0-1021-azure

File hashes

Hashes for ecoindex_compute-5.9.0.tar.gz
Algorithm Hash digest
SHA256 ae3c54d745859eca2beec0e7ecb30199dce254596342affda636ff0d5361c0a8
MD5 06615e3b13f49561b954f5a712dc53bc
BLAKE2b-256 65c47eacb3c68245c8c746dd03343434dbba89187fdc0a63c0eb552d8177c372

See more details on using hashes here.

File details

Details for the file ecoindex_compute-5.9.0-py3-none-any.whl.

File metadata

  • Download URL: ecoindex_compute-5.9.0-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.10.17 Linux/6.8.0-1021-azure

File hashes

Hashes for ecoindex_compute-5.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 70f3536d90dc56819af477eec4f7d3b25e74f317af9027319ef358620a1a4a9d
MD5 d81530c6e97f4d742f2a6549dda04e4f
BLAKE2b-256 fce936d95960d8f5b787ee184bbcbdfc313dc9bed42eeb06b5d57ac6fc407644

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