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.
- 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
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
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
-
Clone or download the repository.
-
Create a new virtual environment for the project. To download virtual environment run
pip install virtualenv
virtualenv venv source venv/bin/activate
-
Install the required python libraries given in the requirements.txt file.
cd spdx-online-tools pip install -r requirements.txt
-
Run Django migrate.
python manage.py migrate
-
(Optional) If you want use xml-editor with licenses/exceptions from spdx license list, download the license name database.
python src/populate.py
-
Start the application.
python manage.py runserver
-
Open
localhost:8000/
in the browser. -
Register and login to use the tools.
python manage.py test
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
Note: While setting up the GitHub OAuth App, set the Homepage URL
to http://localhost:8000/
and the Authorization callback URL
to http://localhost:8000/oauth/complete/github
Here is the exhaustive list of request and response fields of different api tools.
-
Start the server.
python manage.py runserver
-
Send the request to the url with the form input values accordingly. Curl examples are given below.
-
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
-
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
-
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
-
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
The project uses spdx java tools for various tools of the website.