Giter VIP home page Giter VIP logo

elegantupr-api's Introduction

elegantupr-api

API for Elegant Visualisation of ecoinvent Unit Processes

API

Parser

Accepts a ecospold2 file upload and parses it into a readable activity object including name, geography shortname and exchanges.

POST /parser
{
  "name": "medium density fibre board production, uncoated",
  "geography_shortname": "RER",
  "exchanges": {
    "reference_product": [
      {
        "amount": 1.0,
        "compartment": null,
        "name": "medium density fibreboard",
        "production_volume_amount": 11114926.0,
        "unit_name": "m3"
      }
    ],
    "by_products": [
      {
        "amount": 2.00503576,
        "compartment": null,
        "name": "wood ash mixture, pure",
        "production_volume_amount": 22285824.0997538,
        "unit_name": "kg"
      }, ...
    ],
    "from_technosphere": [
      {
        "amount": 287.0,
        "compartment": null,
        "name": "tap water",
        "production_volume_amount": null,
        "unit_name": "kg"
      }, ...
    ],
    "from_environment": [
      {
        "amount": 0.323,
        "compartment": "natural resource",
        "name": "Water, river",
        "production_volume_amount": null,
        "unit_name": "m3"
      }, ...
    ],
    "to_environment": [
      {
        "amount": 1.684904e-07,
        "compartment": "air",
        "name": "Chromium VI",
        "production_volume_amount": null,
        "unit_name": "kg"
      }, ...
    ]
  },
}

Filter

Accepts a jsonified activity object and filters it. By-products only include 4 by-products with the highest production volume amount. Other exchanges only include 5 exchanges with the highest amount aggregating similar exchanges to different compartments.

POST /filter

Running Locally

$ git clone https://github.com/simonroth/elegantupr-api.git
$ cd elegantupr-api

$ virtualenv venv
$ source venv/bin/activate

(venv) $ pip install -r requirements.txt

(venv) $ gunicorn elegantupr.app:app

elegantupr-api should now be running on localhost:8000.

Deploying to Heroku

$ heroku create
$ git push heroku master

$ heroku open

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.