Update: As of September 2022 the JournalsDB API is no longer maintained.
This is the API for JournalsDB and is hosted at https://api.journalsdb.org
pip install -r requirements.txt
DATABASE_URL
environment variable to point to a postgresql databaseflask db upgrade
flask import_issns
, followed by flask import_issn_apis
(second command takes 6+ hours for initial load)Ingest data using flask CLI commands. All ingest functions are stored in the /ingest
directory.
To see a list of available cli commands:
$ flask
Commands:
db Perform database migrations.
import_author_permissions Google sheet from...
import_extension_requests Extension requests:...
import_issn_apis Iterate over issn_metadata table, then fetch...
import_issns Master ISSN list:...
import_open_access Open access data:...
import_repositories Repository article counts:...
Migrations are managed with flask-migrate.
Run the migration files to build the database:
$ flask db upgrade
View current migration status with:
$ flask db current
To create migrations for changed models:
$ flask db migrate -m "Add title field"
CORS is enabled for the entire project via flask-CORS.
All code is formatted with black.
$ black .
You must point to a local postgresql database for testing, as sqlite does not support jsonb columsn.
The default name is journalsdb_test
.
Run tests with:
$ pytest