Skip to content

elifesciences/data-hub-api

Repository files navigation

Data Hup API

This repo includes eLife Data Hub APIs. Currently all API endpoints are DocMap related.

Development Using Virtual Environment

Pre-requisites (Virtual Environment)

  • Python, ideally using pyenv (see .python-version)
  • GCP credentials in ~/.config/gcloud (e.g. via gcloud auth application-default login)

First Setup (Virtual Environment)

make dev-venv

Update Dependencies (Virtual Environment)

make dev-install

Run Tests (Virtual Environment)

make dev-test

Start Server (Virtual Environment)

make dev-start

The server will be available on port 8000.

You can access the API Docs via /docs

Run Regression Test (Virtual Environment)

By default, this will require the server to be running locally. You can also use DATA_HUB_API_REGRESSION_TEST_URL_PREFIX to point to staging or prod.

make dev-regression-test

Update Regression Test Data (Virtual Environment)

Similar to running regression tests, this will also require the server to be running locally by default (which you can override using DATA_HUB_API_REGRESSION_TEST_URL_PREFIX).

You can update the regression test data using the following command:

make dev-update-regression-test-data

This will currently only include the enhanced-preprint data (not Kotahi).

It will update the files in data/docmaps/regression_test/docmap_by_manuscript_id.

Please review the changes carefully.

Development Using Docker

Pre-requisites (Docker)

  • Docker

Run Tests (Docker)

make build test

Start Server (Docker)

make build start logs

The server will be available on port 8000.

You can access the API Docs via /docs

Stop Server (Docker)

make stop

About

Data Hup APIs

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 7

Languages