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:
/
Get the current catalog as human-readable HTML.
HTTP method: GET
/ping
Check that the server is alive. Returns pong
.
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:
filename
: File namedatabase
: Database namesha256
: 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': 'filename on server',
'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.