Skip to main content

Converters for EnviDat metadata

Project description

EnviDat Converters

This project features converters made for EnviDat metadata.

  • EnviDat to JSON-LD
  • EnviDat to DataCite XML
  • EnviDat to RIS
  • EnviDat to DIF
  • EnviDat to ISO 19139
  • EnviDat to BIBTEX
  • EnviDat to DCAT-AP
  • EnviDat to Signposting

It also offers a way to download EnviDat metadata.

So how do I use it?

All you need to do is install the package.

Clone the repository in a folder of your choosing. Then install it. Easy!

We recommend using a virtual environment as described here, but in theory you can also just run the last command.

# Create virtual environment:
python -m venv <virtual-environment-name>

# Activate virtual environment (depends on your OS)
# Linux/MacOS
source <virtual-environment-name>\bin\activate
# Windows
<virtual-environment-name>\Scripts\activate.bat

# Install the package.
pip install .

If you have set this up before and come back to the project at a different time, the only step you need to do is activate the virtual environment.

Once this project is on PyPi, I will add the according instructions here.

Command Line Usage

Command Line Usage

Open your favourite terminal. So far, you have two main functionalities:

  • Getting the metadata directly from EnviDat
  • Converting that metadata to a format of your choosing

Both have the option to either just print the output or save it as a file.

EnviDat metadata

To show or download the metadata, use the following command:

(python) envidat-converter get-data <query>

Query is your search term. It can be a DOI, a dataset name or a dataset ID.

Optional:

To download the dataset, use the --download flag. This will save the file in your current directory.

If you want to specify the path, you can do that with the --outputdir flag.

Examples:

(python) envidat-converter get-data labes

... will print the dataset with the name "labes" in your terminal.

(python) envidat-converter get-data "10.16904/envidat.228" --download --outputdir ".\foldername"

... will save the dataset with the DOI 10.16904/envidat.228 in a new folder called "foldername".

Convert metadata

So far you can convert to the following formats:

  • Datacite (XML)
  • Json LD in the style of Zenodo (JSON)

To use the converter, use:

(python) envidat-converter convert <query> --converter <converter>

Let's break that down:

  • query: query is your search term. It can be a DOI, a dataset name or a dataset ID.
  • converter: this can currently be "datacite", "jsonld", "bibtex", "dif", "ris", "iso", or "dcatap"

Optional:

To download the dataset, use the --download flag. This will save the file in your current directory.

If you want to specify the path, you can do that with the --outputdir flag.

Examples:

(python) envidat-converter convert labes --converter datacite

... will print the dataset with the name "labes" in the datacite format in your terminal.

(python) envidat-converter convert "10.16904/envidat.228" --converter jsonld --download --outputdir ".\foldername"

... will save the dataset with the DOI 10.16904/envidat.228 in a new folder called "foldername".

API usage

API usage

Make sure you have uvicorn installed. Then it's as simple as running

uvicorn envidat_converters.main:app --port 8080

It should load up under http://localhost:8080/. Note that you can always change the port number to whatever fits your needs.

The docs should open up and help you use the API.

  • To convert metadata, use the convert-metadata endpoint. You can use IDs, package names, or DOIs as query.
  • To simply get the EnviDat metadata, use the get-data endpoint. You can use IDs, package names, or DOIs as query.

Addtional information

This repository was tested against Python Versions 3.8, 3.9, 3.10, 3.11, 3.12, 3.13. Version 3.8 and 3.9 did not work due to dependency issues.

config.ini

If you are not just handling production data but, for example, have a local database that you want to test, you can add the environment to config.ini. There is no need to restart or reinstall after making changes.

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

envidat_converter-0.1.6.tar.gz (42.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

envidat_converter-0.1.6-py3-none-any.whl (54.6 kB view details)

Uploaded Python 3

File details

Details for the file envidat_converter-0.1.6.tar.gz.

File metadata

  • Download URL: envidat_converter-0.1.6.tar.gz
  • Upload date:
  • Size: 42.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for envidat_converter-0.1.6.tar.gz
Algorithm Hash digest
SHA256 935cf969567e5cc9e310d0a9a1a43a97997ba1b27d3ee252e39c896b2a4e7201
MD5 501a726511a926350f6bf33a305419d1
BLAKE2b-256 e1ffa84e74788ae0020cd64002839cd4d67a02b4ce65fb0b0e76482e39ab3bd4

See more details on using hashes here.

File details

Details for the file envidat_converter-0.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for envidat_converter-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 22eb46538fdb6a84d87b8810ce9467d787c07a15ac29117fccfc0ccef47a495d
MD5 4a96775c8a2b0759c93d960b591ea55d
BLAKE2b-256 3a6b57c17d21ca99d6fdeee855b7598fae47b80ac5434508887f1b54041027f7

See more details on using hashes here.

Supported by

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