All Projects → spdx → tools-python

spdx / tools-python

Licence: Apache-2.0 License
A Python library to parse, validate and create SPDX documents.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to tools-python

licensor
write licenses to stdout
Stars: ✭ 138 (+112.31%)
Mutual labels:  licensing, spdx
LinkedDataHub
The Knowledge Graph notebook. Apache license.
Stars: ✭ 150 (+130.77%)
Mutual labels:  rdf
disco-dop
Discontinuous Data-Oriented Parsing
Stars: ✭ 40 (-38.46%)
Mutual labels:  parsing
webargs-starlette
Declarative request parsing and validation for Starlette with webargs
Stars: ✭ 36 (-44.62%)
Mutual labels:  parsing
httphead
No description or website provided.
Stars: ✭ 72 (+10.77%)
Mutual labels:  parsing
rdf-delta
A system to propagate changes between RDF Datasets
Stars: ✭ 44 (-32.31%)
Mutual labels:  rdf
parser-combinators
Lightweight package providing commonly useful parser combinators
Stars: ✭ 41 (-36.92%)
Mutual labels:  parsing
jarql
SPARQL for JSON: Turn JSON into RDF using SPARQL syntax
Stars: ✭ 19 (-70.77%)
Mutual labels:  rdf
fefe
Validate, sanitize and transform values with proper TypeScript types and zero dependencies.
Stars: ✭ 34 (-47.69%)
Mutual labels:  parsing
specification
Software Bill of Material (SBOM) standard designed for use in application security contexts and supply chain component analysis
Stars: ✭ 129 (+98.46%)
Mutual labels:  spdx
LSQ
Linked SPARQL Queries (LSQ): Framework for RDFizing triple store (web) logs and performing SPARQL query extraction, analysis and benchmarking in order to produce datasets of Linked SPARQL Queries
Stars: ✭ 23 (-64.62%)
Mutual labels:  rdf
Covfefe
A parser for nondeterministic context free languages
Stars: ✭ 49 (-24.62%)
Mutual labels:  parsing
latex2unicode
Convert LaTeX markup to Unicode (in Scala and Java)
Stars: ✭ 28 (-56.92%)
Mutual labels:  parsing
Bullwinkle
An on-the-fly parser for BNF grammars
Stars: ✭ 39 (-40%)
Mutual labels:  parsing
apple-receipt
Apple InAppPurchase Receipt - Models, Parser, Validator
Stars: ✭ 25 (-61.54%)
Mutual labels:  parsing
LeagueReplayParser
C# library which can read some data from a .rofl file, and start a replay in the client. (no longer actively maintained)
Stars: ✭ 20 (-69.23%)
Mutual labels:  parsing
tokenizr
String Tokenization Library for JavaScript
Stars: ✭ 70 (+7.69%)
Mutual labels:  parsing
link-redux
Linked Data Rendering for humans with React
Stars: ✭ 28 (-56.92%)
Mutual labels:  rdf
php.json
A library for simplifying JSON linting and validation.
Stars: ✭ 59 (-9.23%)
Mutual labels:  parsing
IGUANA
IGUANA is a benchmark execution framework for querying HTTP endpoints and CLI Applications such as Triple Stores. Contact: [email protected]
Stars: ✭ 22 (-66.15%)
Mutual labels:  rdf

Python library to to parse, validate and create SPDX documents

Linux macOS Windows
Linux build status macOS build status Windows build status

Information

This library implements SPDX tag/value and RDF parsers, validators and handlers in Python.

History

This is the result of an initial GSoC contribution by @ah450 (or https://github.com/a-h-i) and is maintained by a community of SPDX adopters and enthusiasts.

License

Apache-2.0

Features

  • API to create and manipulate SPDX documents.
  • Parse and create Tag/Value, RDF, JSON, YAML, XML format SPDX files

TODOs

  • Update to full SPDX v2.1
  • Add to full license expression support

How to use

Command-line usage:

  1. PARSER (for parsing any format):
  • Use parser --file <filename> where <filename> is the location of the file.
    Try running : parser --file data/SPDXRdfExample.rdf.

  • Or you can use parser only and then it will automatically prompt/ask for filename.

  • for help - use parser --help

  1. CONVERTOR (for converting one format to another):
  • If I/O formats are known:

    • Use convertor --infile/-i <input_file> --outfile/-o <output_file> where <input_file> is the location of the file to be converted (Note: only RDF and Tag formated supported) and <output_file> is the location of the output file.
      Try running : convertor --infile data/SPDXRdfExample.rdf --outfile output.json
  • If I/O formats are not known:

    • Use convertor --from/-f <input_format> <input_file> --to/-t <output_format> <output_file> where <input_format> is the manually enterred format of the input file (can be either rdf or tag) and <out_format> (can be tag, rdf, json, yaml, xml) is the manually enterred format of the output file. Try running : convertor --from tag data/SPDXTagExample.in --to yaml output.out
  • If anyone format is known and other is not, you can use the mixture of the above two points.
    Ex. : convertor -f rdf data/SPDXRdfExample.xyz -o output.xml

  • for help - use convertor --help

Installation

As always you should work in a virtualenv or venv. You can install a local clone of this repo with yourenv/bin/pip install . or install from PyPI with yourenv/bin/pip install spdx-tools. Note that on Windows it would be Scripts instead of bin.

How to run tests

Tests framework is using pytest

pip install pytest
pytest -vvs

Development process

We use the GitHub flow that is described here: https://guides.github.com/introduction/flow/

So, whenever we have to make some changes to the code, we should follow these steps:

  1. Create a new branch: git checkout -b fix-or-improve-something
  2. Make some changes and the first commit(s) to the branch: git commit --signoff -m 'What changes we did'
  3. Push the branch to GitHub: git push origin fix-or-improve-something
  4. Make a pull request on GitHub.
  5. Continue making more changes and commits on the branch, with git commit --signoff and git push.
  6. When done, write a comment on the PR asking for a code review.
  7. Some other developer will review your changes and accept your PR. The merge should be done with rebase, if possible, or with squash.
  8. The temporary branch on GitHub should be deleted (there is a button for deleting it).
  9. Delete the local branch as well:
    git checkout master
    git pull -p
    git branch -a
    git branch -d fix-or-improve-something
    

Besides this, another requirement is that every change should be made to fix or close an issue: https://guides.github.com/features/issues/ If there is no issue for the changes that you want to make, create first an issue about it that describes what needs to be done, assign it to yourself, and then start working for closing it.

Dependencies

Support

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].