drax

If you provide XML files, it will convert them to JSON files and post with REST API

https://github.com/kelvinlyy/drax

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (7.3%) to scientific vocabulary

Keywords

datacite
Last synced: 6 months ago · JSON representation ·

Repository

If you provide XML files, it will convert them to JSON files and post with REST API

Basic Info
  • Host: GitHub
  • Owner: kelvinlyy
  • License: mit
  • Language: Python
  • Default Branch: master
  • Homepage: https://api.datacite.org/
  • Size: 29.3 KB
Statistics
  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 1
Topics
datacite
Created over 4 years ago · Last pushed over 4 years ago
Metadata Files
Readme License Citation Codemeta

README.md

DRAX (DataCite Rest Api for Xml)

DRAX is a Python program for posting bulk DOIs metadata in XML format using DataCite REST API

If you provide XML files, it will convert them to JSON files and post with REST API


Getting Started

xml_post_parser.py is the program you will call to do the task

It will call two python classes: * class_xml_encode.py: encode XML files to JSON envelope

  • class_json_post.py: post JSON envelopes to server port


Usage

Check the configuration file xml_post_parser_config.json and start configure your program:


Important fields

``` "server_port":

the location you want to post your files to

"bearerauthkey":

your Bearer Auth key to access DataCite REST API

"prefix":

namespace of the DOIs you are using

"schema_url":

schema for the DOIs ```

Folder names

``` "xml_folder":

the directory for your input XML files

"json_folder":

the directory for your JSON envelopes to be stored at

"processedxmlfolder":

the directory for your processed XML files

"postedjsonfolder":

the directory for your successfully posted JSON envelopes

"postfailedfolder":

the directory for your JSON envelopes that failed to post

```


Then from the config file, use the value of "xml_folder" as the name to create a folder in the same directory

Store your xml files to be posted to the folder


Last, run xml_post_parser.py

python python xml_post_parser.py

XML files will begin to be encoded into JSON files and then posted to the server port

Successfully posted files will be stored at "posted_json_folder"

Failed files will be stored at "post_failed_folder"


Additional file for testing

tests/test_server.py:

construct a dummy server at http://localhost:5000

you can post data to http://localhost:5000 and view the posted data on http://localhost:5000/data

Remember to change "server_port" in the config file to http://localhost:5000/



This work was carried out under the ITC STEM Internship Scheme from the The Hong Kong University of Science and Technology in collaboration with GigaScience - BGI.

Owner

  • Login: kelvinlyy
  • Kind: user

Citation (CITATION.cff)

authors: 
  -
    family-names: Lai
    given-names: "Yung Yin"
cff-version: "1.1.0"
date-released: 2021-07-14
keywords: 
  - dois
  - restapi
  - datacite
license: MIT
message: "If you use this software, please cite it using these metadata."
repository-code: "https://github.com/kelvinlyy/drax"
title: "DataCite Rest Api for Xml"
version: "1.0"

CodeMeta (codemeta.json)

{
  "@context": "https://doi.org/10.5063/schema/codemeta-2.0",
  "@type": "SoftwareSourceCode",
  "license": "https://spdx.org/licenses/MIT",
  "codeRepository": "https://github.com/kelvinlyy/drax.git",
  "dateCreated": "2021-06-29",
  "datePublished": "2021-07-14",
  "dateModified": "2021-07-13",
  "downloadUrl": "https://github.com/kelvinlyy/drax.git",
  "issueTracker": "https://github.com/kelvinlyy/drax/issues",
  "name": "DRAX",
  "version": "1.0",
  "description": "It is a Python program for posting bulk DOIs metadata in XML format using DataCite REST API\n\nIf you provide XML files, it will convert them to JSON files and post with REST API",
  "applicationCategory": "Dois",
  "developmentStatus": "active",
  "isPartOf": "https://api.datacite.org/",
  "keywords": [
    "dois",
    "datacite",
    "restapi"
  ],
  "programmingLanguage": [
    "Python 3"
  ],
  "runtimePlatform": [
    "Python Runtime Environment"
  ],
  "operatingSystem": [
    "Linux",
    "Windows",
    "MacOS"
  ],
  "softwareRequirements": [
    "Python 3"
  ],
  "relatedLink": [
    "https://api.datacite.org/"
  ],
  "author": [
    {
      "@type": "Person",
      "givenName": "Yung Yin",
      "familyName": "Lai",
      "email": "kelvinklyy@gmail.com",
      "affiliation": {
        "@type": "Organization",
        "name": "DataCite"
      }
    }
  ],
  "contributor": [
    {
      "@type": "Person",
      "@id": "https://orcid.org/0000-0003-3484-6875",
      "givenName": "Kristian",
      "familyName": "Garza",
      "email": "kgarza@datacite.org",
      "affiliation": {
        "@type": "Organization",
        "name": "Product Designer, DataCite"
      }
    }
  ]
}

GitHub Events

Total
  • Watch event: 1
Last Year
  • Watch event: 1

Dependencies

requirements.txt pypi
  • requests *