co2accounting
v1.0.24
Published
CO2 Accounting using CO2 Offset API
Downloads
10
Maintainers
Readme
co2accounting
GHG accounting and decompensation in accordance to ISO14064-(1,2,3) using CO2 Offset API
Installation
Use the package manager npm to install co2accounting.
from shell
npm install --g co2accounting
as a module
npm install --save co2accounting
cp sample.env .env
Edit the .env and set your RapidAPI-Key.
via source
Checkout source code from GIT and install dependencies
git clone https://github.com/energychain/co2accounting-rapidapi.git
cd co2accounting-rapidapi
npm install
Usage
Use as command line tool (CLI)
In order to script and/or include co2accounting
a simple CLI-Interface is available. However, you might want to extend/modify the cli.js to fit to your particular needs.
Installation
npm install -g --save co2accounting
co2accounting -h
| Command | Description |
|---------|-------------|
| whoami
| Gives your Account Id |
| compensate [options] <grams>
| Direct compensate given number grams or CO2 |
| compensateEvent [options] <eventId>
| Compensate remaing emission of an event |
| emission [options] <grams>
| Add emission to account. |
| balance [options]
| Retrieves CO2 Accounting Balance |
| footprint [options] <searchTerm>
| Searches in Footprint database |
| events [options]
| Retrieves emission events |
| identity [options] <account>
| Retrieves Nature and Details of given identity |
| help [command]
| display help for command |
| allow <sender> <permitted>
| If permitted is true the given sender is allowed to transfer co2events to this account |
| transfer <event> <to>
| Transfer a CO2event from this account to another account. |
Use as module (in your code)
The main usage of co2accounting
is from within your code as node module. Best reference are the test cases.
const CO2Accounting = require('co2accounting');
const instance = new CO2Accounting('INSERT-RAPIDAPI-KEY');
console.log(await instance.whoami());
Try on this on RunKit.
Tests
Checkout source code first and install dependencies.
Create a .env
file containing your RapidAPI Key Retrieve/Signup. If you want to use co2accounting
without an RapidAPI account, you might get in contact with STROMDAO to get a precharged account.
RAPIDAPIKEY=YOURAPIKEY-GOES-HERE
Run tests
npm test
Expected Results
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests as appropriate. Details on contributing.
Maintainer / Imprint
Project Website: https://co2offset.io/