Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.
/ ecoindex_python Public archive

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

License

Notifications You must be signed in to change notification settings

cnumr/ecoindex_python

Repository files navigation

⚠️ This project is being replaced by ecoindex_python_fullstack and will be archived soon. Please refer to the new project for any contribution or issue. ⚠️

ECOINDEX PYTHON

Quality check PyPI version

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

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

Contribute

You need poetry to install and manage dependencies. Once poetry installed, run :

poetry install

Tests

poetry run pytest

Disclaimer

The LCA values used by ecoindex to evaluate environmental impacts are not under free license - ©Frédéric Bordage Please also refer to the mentions provided in the code files for specifics on the IP regime.

About

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

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Languages