co2accounting

1.0.24 • Public • Published

co2accounting

GHG accounting and decompensation in accordance to ISO14064-(1,2,3) using CO2 Offset API

CO2OffsetNPM Version NPM DownloadsCircleCI

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

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

STROMDAO GmbH
Gerhard Weiser Ring 29
69256 Mauer
Germany

+49 6226 968 009 0

kontakt@stromdao.com

Handelsregister: HRB 728691 (Amtsgericht Mannheim)

Project Website: https://co2offset.io/

LICENSE

Apache-2.0

Package Sidebar

Install

npm i co2accounting

Weekly Downloads

1

Version

1.0.24

License

Apache-2.0

Unpacked Size

179 kB

Total Files

18

Last publish

Collaborators

  • zoernert