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.
The output from the EnviDat to JSON-LD converter is also compatible with the POLDER JSON-LD format. POLDER is an international multidiscplinary Polar Data Search portal created to aid the search for polar data.
Additionally, the project includes a DataCite to OpenDataSwiss (a variant of DCAT AP CH) converter as well as a DataCite to Ro-Crate converter - please note, we currently only support a handful of publishers and the metadata has to be of the ETH metadata standard.
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.
Metadata
Release files for envidat-converter 0.4.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| envidat_converter-0.4.6.tar.gz | 69.1 kB | Without provenance | Details for envidat_converter-0.4.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| envidat_converter-0.4.6-py3-none-any.whl | Python 3 | none | any | Details for envidat_converter-0.4.6-py3-none-any.whl |
Total release size: 141.3 kB
Release files / envidat_converter-0.4.6.tar.gz
| Download URL | envidat_converter-0.4.6.tar.gz |
|---|---|
| Size | 69.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aca8f4e2209731e172ce63e513986d4712ebab1cdf8067d759e09604f278a53c
|
|
BLAKE2b-256 checksum How to use checksums |
f96fe3cfe22e26ca602455bb1552bafccb2dd46fe595f5e19cb4d21ad756e4a5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Release files / envidat_converter-0.4.6-py3-none-any.whl
| Download URL | envidat_converter-0.4.6-py3-none-any.whl |
|---|---|
| Size | 72.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7ed1517f296b7462e4a2bd205030128076daa40035d6139f129fda4e6872fff0
|
|
BLAKE2b-256 checksum How to use checksums |
7da0c1f0a5d108c64332ce14cc5be1ef49da9b9ec67c41167ef4393cdd80404b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Security for envidat-converter 0.4.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.