Tethys.SPDX.Interfaces 2.1.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package Tethys.SPDX.Interfaces --version 2.1.1                
NuGet\Install-Package Tethys.SPDX.Interfaces -Version 2.1.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Tethys.SPDX.Interfaces" Version="2.1.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Tethys.SPDX.Interfaces --version 2.1.1                
#r "nuget: Tethys.SPDX.Interfaces, 2.1.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Tethys.SPDX.Interfaces as a Cake Addin
#addin nuget:?package=Tethys.SPDX.Interfaces&version=2.1.1

// Install Tethys.SPDX.Interfaces as a Cake Tool
#tool nuget:?package=Tethys.SPDX.Interfaces&version=2.1.1                

Tethys.SPDX

License Build status Nuget REUSE status SBOM

The Software Package Data Exchange (SPDX) is an open standard for describing a software bill of material. SPDX focuses especially on licensing and copyright imformation.

License and copyright scanners like FOSSology for example use this standard to provide their scan results.

Having a format to describe all the different scenarios of license findings, license relations, and copyright findings is not trivial, so SPDX can get quite complex.

The libraries in this project support two tasks:

  • load the SPDX license list and provide it to .Net applications
  • parse SPDX files and provide the contained data in a .Net way

Please note that due to the complexity of the SPDX standard not all possible SPDX files can be parsed. But the libraries are open source, so feel free to enhance them.

Get Package

The following packages are available on NuGet:

This library has been influenced by the following GitHub projects:

System.Text.Json instead of Newtonsoft.Json

There an ongoing discussion whether to use System.Text.Json instead of Newtonsoft.Json.
Well, moving from Newtonsoft.Json to System.Text.Json is not straightforward and costs quite some effort. SPDX JSON reading and writing is based on many Newtonsoft JsonConverters and at the moment the is no plan to change this. If someone wants to take the challenge, well, go ahead and do a pull request.

Current status:
The following packages do not use any JSON support:

  • Tethys.SPDX.ExpressionParser
  • Tethys.SPDX.Support

The following packages use System.Text.Json:

  • Tethys.SPDX.Interfaces
  • Tethys.SPDX.KnownLicenses, netstandard2.0

The following packages use Newtonsoft.Json:

  • Tethys.SPDX.Model
  • Tethys.SPDX.SimpleSpdxParser
  • Tethys.SPDX.Writer

SPDX

See https://spdx.org/licenses/ for more details on SPDX, the software package data exchange format, the SPDX license identifiers and matching guidelines.

The Software Package Data Exchange (SPDX) Specification https://spdx.github.io/spdx-spec/

XML data of all SPDX licenses:
https://github.com/spdx/license-list-XML

How to use Tethys.SPDX

The SPDX license information is not part of the libraries, you have to download it from SPDX License List and place it in a local folder.

Very simple demo

A minimal code snippet looks like this

var knownLicenseManager = new KnownLicenseManager();
knownLicenseManager.LoadSpdxSourceFiles(...SPDX license files...);
knownLicenseManager.LoadSpdxExceptionFiles(...SPDX license exception files...);

var reader = new RdfParser(knownLicenseManager);
var spdxDoc = reader.ReadFromFile(...SPDX file...);
...

Just run the demo application

dotnet run --project .\SpdxParserDemo\SpdxParserDemo.csproj .\TestData\yaml-0.1.0.zip.spdx2.rdf.xml

or

dotnet run --project .\SpdxParserDemo\SpdxParserDemo.csproj .\TestData\SPDXJSONExample-v2.3.spdx.json

Build

Requisites

  • Visual Studio 2022
  • NuGet access

Required NuGet Packages

  • Tethys.Logging, version 1.6.1
  • Tethys.Xml, version 1.1.0
  • (Newtonsoft.Json, version 13.0.3)
  • (System.Text,Json, version 8.0.3)

Build Solution

Just use the basic dotnet command:

dotnet build

License

Tethys.SPDX is licensed under the Apache License, Version 2.0.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Tethys.SPDX.Interfaces:

Package Downloads
Tethys.SPDX.Model

SPDX support for .Net applications

Tethys.SPDX.KnownLicenses

SPDX support for .Net applications

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.1.2 1,028 5/8/2024
2.1.1 329 4/7/2024
2.1.0 283 3/24/2024
2.0.0 265 2/21/2024
1.0.1 396 3/31/2023
1.0.0 510 2/15/2022