Skip to content

JonasAls89/ecovadis

Repository files navigation

Ecovadis

A connector for using the EcoVadis API

Prerequisites

python3

API Capabalities

Supports GET

Supports page_size and paging

How to:

Run program in development

This repo uses the file package.json and yarn to run the required commands.

  1. Make sure you have installed yarn.
  2. Creata a file called helpers.json and set username and password in the following format:
{
    "username": "some username",
    "password": "some password"
    "base_url": "some url"
}
  1. run:
        yarn install
    
  2. execute to run the script:
        yarn swagger
    

Run program in production

Make sure the required env variables are defined.

Use program as a SESAM connector

System config :

    {
    "_id": "ecovadis",
    "type": "system:microservice",
    "docker": {
        "environment": {
        "password": "$SECRET(ecovadis-password)",
        "username": "$ENV(ecovadis-username)",
        "base_url": "$ENV(ecovadis-base_url)",
        "page_size": "$ENV(page_size)" <- this one is optional
        },
        "image": "sesamcommunity/ecovadis:latest",
        "port": 5000
    },
    "verify_ssl": true
    }

Example Pipe config :

    {
    "_id": "ecovadis-evdata",
    "type": "pipe",
    "source": {
        "type": "json",
        "system": "ecovadis",
        "url": "/entities/get/EVData"
    },
    "transform": {
        "type": "dtl",
        "rules": {
        "default": [
            ["copy", "*"]
        ]
        }
    }
    }

Routes

This connector works using dynamic routing when requesting data from the Ecovadis API. In your browser, you can therefore set specific query parameters for each resource, i.e. "EVData", which results in :

    /entities/get/EVData

About

A connector for the Ecovadis API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published