Download the PHP package green-elephpant/carbon-aware without Composer
On this page you can find all versions of the php package green-elephpant/carbon-aware. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download green-elephpant/carbon-aware
More information about green-elephpant/carbon-aware
Files in green-elephpant/carbon-aware
Package carbon-aware
Short Description SDK to help your applications reduce carbon emissions
License MIT
Informations about the package carbon-aware
Green ElePHPant - CarbonAware
The Green ElePHPant wants to help you to reduce the carbon emissions of your software.
One way of doing so is to utilize energy when it is the "greenest" - i.e., when it most of it comes from renewable energies rather burning fossil fuels.
GreenElephpant\CarbonAware
is a simple wrapper for APIs that provide information about the current or future carbon
intensity at many regions worldwide. Currently, we support CO2Signal and
Electricity Maps. Hopefully more to come!
Key concept
Building carbon aware applications means that certain activities or jobs will not, or at least in lower frequency, be carried out if the carbon intensity is too high.
For example, if the carbon intensity is low, we can update a dashboard more often than if it is not:
Installation
Simply use composer to add GreenElephpant\CarbonAware
to your project:
composer require green-elephpant/carbon-aware
Configuration
GreenElephpant\CarbonAware
was designed to require as few external dependencies as possible so that it can fit in
almost every project. It uses several PSR for e.g. HTTP messages (PSR-17) and clients (PSR-18), so it won't work out
of the box but require a bit (but not a lot) of hand wiring.
Internals
GreenElephpant\CarbonAware
uses 3rd party APIs to receive carbon intensity data. To ensure future-proof and easy
maintenance,
Connector
: the actual API wrapper. Provides easy access to the relevant API endpoints (note: only those endpoints that are relevant for this project are supported.DataProvider
: the link betweenCarbonAwareService
: provides uniform API
All versions of carbon-aware with dependencies
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/simple-cache Version ^1.0
ext-json Version *