Skip to main content

Tool and web service for exchange of columnar life cycle inventory data

Project description

dardanelles

Table of Contents

Background

Concepts

Installation

Client

Server

dardanelles is also a web service for LCI data exchange. The default URL is lci.brightway.dev, but you can run your own server. The server uses flask.

Running the web service

Run the flask application any way you want. For example, to run the test server (not in production!), do:

.. code-block:: bash

export FLASK_APP=/path/to/dardanelles/__init__.py
flask run

API endpoints

The following API endpoints are supported:

/

Ping the server. Returns something like dardanelles life cycle inventory web data exchange, version (0, 1).

HTTP method: GET

/catalog

Get the list of datasets available

HTTP method: GET

Response

  • 200: Return a JSON payload of the form:
    [
        ('file name', 'database name', 'hex-encoded sha256 hash of file'),
    ]

/upload

Upload a datapackage.

HTTP method: POST

Parameters

Post the following required form data:

  • name: File name
  • sha256: SHA 256 hash of file

The file should be in the field file.

Responses

  • 201: The file was uploaded and registered. Returns a JSON payload:
    {
        'filename': 'some file name',
        'database name': 'reported name of the database',
        'sha256': 'hex-encoded sha256 hash of file contents'
    }
  • 400: The request form was missing a required field
  • 406: The input data was invalid (either the hash wasn't correct or the file isn't readable)
  • 409: File already exists
  • 413: The uploaded file was too large (current limit is 250 MB)

/download

Request the download of the file.

HTTP method: POST

Parameters

Post the following form data:

  • hash: SHA 256 hash of the file

Responses

  • 200: The requested file will be returned
  • 400: The request form was missing a required field
  • 404: A file for this hash was not found

Contributing

Your contribution is welcome! Please follow the pull request workflow, even for minor changes.

When contributing to this repository with a major change, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Documentation and coding standards

Maintainers

License

BSD-3-Clause.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dardanelles-0.1.dev0.tar.gz (14.0 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page