Coder Social home page Coder Social logo

databus-upload's Introduction

README

Setup & Install

# For Ubuntu
sudo apt install python3 python3.10-venv
# setting venv to "virtualenv"
python3 -m venv virtualenv
source virtualenv/bin/activate
# getting python dependency
pip install -r requirements.txt

Credentials

create an .env file with the api keys

# Zenodo
ZENODO_ACCESS_TOKEN=XXX
ZENODO_ENDPOINT=XXX
ZENODO_SANDBOX=XXX

# Databus
DATABUS_API_KEY=XXX
DATABUS_ENDPOINT=XXX
DATABUS_CONTEXT_URL=XXX

# Moss
MOSS_ENDPOINT=XXX

Quickstart

An example run with a sample csv and json. Example files were taken from https://databus.openenergyplatform.org/anik/Industry_test/ind_steel_oxyfu_0/v1 MOSS Prov-O information was added to metadata.json

CSVFILE="example-upload/model_draft__ind_steel_oxyfu_0.csv"
OEMETADATA="example-upload/metadata.json"
python3 main.py --complete $CSVFILE $OEMETADATA

Setup

  • Make sure Python3 is installed (3.7 or higher)
    • sudo apt install python3
  1. Create virtual environment (execute the command venv)
python3 -m venv /path/to/new/virtual/environment
  1. Activate virtual environment
source <venv>/bin/activate
  1. Install required packages
pip install -r requirements.txt
  1. Run the program (e.g. python3 main.py --help)
usage: main.py [-h] [--complete csv_file metadatafile]

Publish on Zenodo and Databus

options:
  -h, --help            show this help message and exit
  --complete csv_file metadatafile
                        Upload on Zenodo and Databus
  1. Example: Upload File to Zenodo, publish the Deposit and publish the metadata on the Databus

This command creates a new deposit, uploads a file in a specified directory to Zenodo and publishes the metadata on the databas specified under the parameters:

  • csv
    • path to the csv that will be uploaded to zenodo
  • metadata.json
    • path to the metadata.json describing the csv data
  • version
    • artifact version on the databus
  • (Optional) username
    • if not specified the user name is set to "prototype"
python3 main.py --complete <file-to-csv> <file-to-metadatajson>

databus-upload's People

Contributors

jonathanjustavino avatar kurzum avatar

Watchers

 avatar

Forkers

kurzum

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.