Git Product home page Git Product logo

losh-okh-tool's Introduction

LOSH OKH tool

License: AGPL-3.0-or-later REUSE status Repo Package Releases Documentation Releases Dependency Status Build Status

In cooperation with FabCity Hamburg In cooperation with Open Source Ecology Germany

A CLI tool to deal with OKH data files. Its main functionalities are:

  • validation of, and
  • conversion between

different formats of OKH

Definitions

  • LOSH: A Library of Open Source Hardware - technical documentation in an open graph database.
  • OKH: Open Know-How - A standard for OSH project meta-data.

Intro

This repo contains two pieces of software:

  • okh-tool
  • fetch-n-conv-v1

and it uses the OKH JSON-Schemas repo as submodule.

The okh-tool can:

  • convert manifest files from one version of the OKH standard to an other
  • validate manifest files of the different OKH standard versions. It does so by using the above mentioned JSON Schema files.

The fetch-n-conv-v1 script will:

  1. fetch publicly registered OKH v1 manifest files
  2. clean them up
  3. validate them
  4. convert them to OKH LOSH (aka "v2")
  5. validate the generated OKH LOSH manifest files

Usage

Conversion and Validation

The okh-tool is written in rust, and can be compiled like this:

cargo build --release

This will produce the stand-alone binary tool in target/release/okh-tool.

To run it, you have these options for conversion:

$ okh-tool conv --help
okh-tool-conv 0.1.0



Converts one format into an other (currently only OKH-v1 to OKH-LOSH)

USAGE:
    okh-tool conv [OPTIONS] <INPUT> [OUTPUT]

ARGS:
    <INPUT>     The input file or dir path
    <OUTPUT>    The output file or dir path

OPTIONS:
    -c, --continue     If the input path is a directory, continue processing further files, even
                       after an error
    -h, --help         Print help information
    -o, --overwrite    If the outout file alreayd exists, overwrite it, instead of skipping the
                       conversion
    -r, --recursive    If the input path is a directory, search for input files recursively
    -V, --version      Print version information

and these for validation:

$ okh-tool val --help
okh-tool-val 0.1.0



Validates manifest files for validity using JSON Schema (currently supports OKH-v1 and OKH-LOSH)

USAGE:
    okh-tool val [OPTIONS] <INPUT>

ARGS:
    <INPUT>    The input file or dir path

OPTIONS:
    -c, --continue                     If the input path is a directory, continue processing further
                                       files, even after an error
    -h, --help                         Print help information
    -o, --okh-version <okh-version>    If the input path is a directory, search for input files
                                       recursively [possible values: v1, losh]
    -r, --recursive                    If the input path is a directory, search for input files
                                       recursively
    -V, --version                      Print version information

Fetching and converting OKH v1

Once you have the above described okh-tool ready (it is required by this script), you may just start the whole process like follows; but be wary, this may take around 3h (99+% of which is spent downloading). The already downloaded files will not be re-downloaded when you abort the process and start a-new.

./fetch-n-conv-v1

Funding

This project was funded by:

  • the European Union's Horizon 2020 research and innovation program, under grant agreement no. 869984, in the context of the OPEN!NEXT Project, from November 2021 (project start) until July 2022.

    Logo of the European Commission

  • the European Regional Development Fund (ERDF) in the context of the INTERFACER Project, from August 2022 until March 2023.

    Logo of the EU ERDF program

losh-okh-tool's People

Contributors

hoijui avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

elijahahianyo

losh-okh-tool's Issues

Allow to generate manifest (TOML) from project directory

Given a project repository (local checkout),
we would generate an okh.toml manifest file,
with as much data as we manage to gather automatically.
The remaining fields may be:

  1. omitted,
  2. added with placeholder values
    (like "TODO" or "https://TODO.com/YOUR_ORG/YOUR_REPO/")
  3. same as 2., but commented out

Previous issue: https://gitlab.com/OSEGermany/osh-tool/-/issues/4

NOTE:

Implement sub-set requirement checking

As of now, there is only one sub-set defined: the required properties.
It would be useful though, if we have more such sets defined (e.g. recommended and optimal) within OKH or the tooling,
but also to allow external entities to define such sets and publish them in a way compatible with our tooling.

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.