Code Monkey home page Code Monkey logo

spdx-online-tools's Introduction

GSoC Logo

spdx-online-tools

Source for the website providing online SPDX tools. The tool provides an easy all-in-one website to upload and parse SPDX documents for validation, comparison and conversion and search SPDX license list. Here you can find more about the working of the tool.

Features

  • Upload and parse SPDX Documents
  • Validate SPDX Documents
  • Compare Multiple SPDX Rdf Files
  • Convert one SPDX format to another
  • Compare License text to the SPDX listed Licenses

Requirements (Linux/Debian/Ubuntu)

Either the Sun/Oracle JDK/JRE Variant or OpenJDK. Python 2.6+.

Debian/Ubuntu users will have to install g++ and python-dev first:

sudo apt-get install g++ python-dev

Requirements (Windows)

Windows users need a Python installation and C++ compiler:

  • Install some version of Python (2.7 or higher), e.g., Anaconda is a good choice for users not yet familiar with the language
  • Install a Windows C++ Compiler

Installation

  1. Clone or download the repository.

  2. Create a new virtual environment for the project. To download virtual environment run pip install virtualenv

    virtualenv venv
    source venv/bin/activate
  3. Install the required python libraries given in the requirements.txt file.

    cd spdx-online-tools
    pip install -r requirements.txt
  4. Run Django migrate.

    python manage.py migrate
  5. (Optional) If you want use xml-editor with licenses/exceptions from spdx license list, download the license name database.

    python src/populate.py
  6. Start the application.

    python manage.py runserver
  7. Open localhost:8000/ in the browser.

  8. Register and login to use the tools.

How to Run Tests

python manage.py test

GitHub Developer Sensitive Data

The settings.py file uses sensitive data to work with the GitHub API. For that reason, sensitive data is not checked into source. Due to that lack of data, the following error could rise when running the app:

from secret import getGithubToken, getGithubKey, getGithubSecret, getSecretKey ImportError: No module named secret

To avoid this error and allow the tool to use the GitHub API, the file src/src/secret.py should be included into the source. The file should contain the following lines:

def getGithubKey():	
    return 'GHKEYXXX'
	
def getGithubSecret():	
    return 'GHSECRETXXX'
	
def getSecretKey():
    return 'DJANGOSECRETXXX'

where:

  • GHKEYXXX is the Client ID for the Github Oauth Apps
  • GHSECRETXXX is the Client ID for the Github Oauth Apps
  • DJANGOSECRETXXX is the Django secret

How to Use API

Here is the exhaustive list of request and response fields of different api tools.

  1. Start the server.

    python manage.py runserver
  2. Send the request to the url with the form input values accordingly. Curl examples are given below.

  3. For validation tool, send the request to /api/validate/.

    curl -X POST -u <admin>:<password> -F "file=@<fileInput>" -H "Accept: application/json" http://localhost:8000/api/validate/ | json_pp
  4. For compare tool, send the request to /api/compare/.

    curl -X POST -u <admin>:<password> -F "file1=@<fileInput1>" -F "file2=<fileInput2>" -F "rfilename=<resultFileName>" -H "Accept: application/json" http://localhost:8000/api/compare/ | json_pp
  5. For convert tool, send the request to /api/convert/.

    curl -X POST -u <admin>:<password> -F "file=@<fileInput>" -F "cfilename=<resultFileNameWithExtension>" -F "from_format=<convertFrom>" -F "to_format=<convertTo>" -H "Accept: application/json" http://localhost:8000/api/convert/ | json_pp
  6. For license check tool, send the request to /api/check_license/.

    curl -X POST -u <admin>:<password> -F "file=@<fileInput>" -H "Accept: application/json" http://localhost:8000/api/check_license/ | json_pp

Dependencies

The project uses spdx java tools for various tools of the website.

spdx-online-tools's People

Contributors

rtgdk avatar techytushar avatar gaalocastillo avatar goneall avatar wking avatar freddy28 avatar nezhar avatar susg avatar

Watchers

James Cloos avatar

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.