The dataverse-importer API can be used to import the JSON metadata of a dataset in to a Dataverse instance. The metadata file needs to be formatted according to what's expected by the Dataverse Native API.
This project uses:
- Python 3.9
- FastAPI
- Poetry
The default port in the example .env is 8090, change it to fit your needs.
cp dot_env_example .env
make build
Returns the current version of the API
Imports JSON metadata of a dataset into a given Dataverse.
- doi (optional) - e.g. doi:10.5072/FK2/1YCZOL - DOI permanently identifying the dataset, if no DOI is given Dataverse will generate a DOI for the dataset.
- metadata - link to example - The metadata describing a dataset in JSON formatted for Dataverse
- base_url - e.g. https://portal.odissei.nl/ - The URL of the Dataverse instance.
- dt_alias - e.g. dans-easy - Name of the specific Dataverse in the Dataverse instance to target.
- api_token - e.g. 12345678-ab12-12ab-abcd-a1b2c3d4e5g6 - API token of the specific Dataverse. (Login to the Dataverse instance as admin and click your username in the top right to find your token.)
When successful, the API call will return a confirmation message containing the dataset's PID and database id. The call will return an exception on a failed attempt further elaborating what went wrong.