Skip to main content

TrustSource Legal Check tool.

Project description

TS-Legalcheck

ts-legalcheck is a tool for automatically checking legal obligations and violations related to the use of software components licensed under one or more open-source licenses within a project. It consists of a powerful constraints engine leveraging the state-of-the-art SMT solver Z3 and several flexible and easily extendable sets of rules describing constraints and definitions extracted from various open-source licenses. The internal format for constraints and definitions allows formal definitions without limitations, enabling not only switching between different models but also combining them. One great example is the use of the OSADL checklists, available as a model for ts-legalcheck, together with a set of violation rules developed by EACG GmbH.

Introduction

The following diagram represents the main functional principle of ts-legalcheck. The tool accepts as input a model consisting of data extracted from open-source licenses. It contains known rights, obligations, and terms, as well as different rules describing in which situations certain obligations apply and, for example, which conditions may violate license usage.

alt text

Besides a model, the ts-legalcheck engine also expects user input describing the legal settings of a project, which define different aspects such as distribution model, distribution form, or modification of third-party components used in the project. We refer to such input as a use case or legal situation. Based on the model, legal settings, and the set of open-source licenses used in the project, the engine decides whether the usage of certain licenses is possible in the provided use case and, if so, provides a set of obligations that must be fulfilled.

The different models created by EACG GmbH can be found in the data/LicenseConstraints_vX.[json|toml] files, and the OSADL model in the data/osadl/LicenseConstraints_v1.0.toml file.

Installation

ts-legalcheck is available as a PyPI package as well as a ready-to-use Docker image.

PyPI

Requirements: Python >= 3.10

pip install ts-legalcheck

Docker

docker pull trustsource/ts-legalcheck

Usage

Installed via PyPI

When ts-legalcheck is installed from PyPI, it can be used directly as a command-line tool from the shell.

License Test

The test command is used to check whether a use case violates license usage and, if not, provides a list of obligations that must be fulfilled:

ts-legalcheck test -l <LICENSE> -d <MODEL LOCATION> <USE-CASE LOCATION> 
Example:

The following example tests if the Apache-2.0 license can be used in a project with the legal settings from examples/sc01_ProprietarySoftware.toml and, if so, which obligations must be fulfilled.

ts-legalcheck test -l Apache-2.0 -d data/LicenseConstraints_v4.5.toml examples/sc01_ProprietarySoftware.toml

Installed as a Docker image

When ts-legalcheck is pulled as a Docker image, it can be executed within a Docker container. For example, the previous example can be executed using Docker as follows:

docker run -it --rm -v ./examples:/examples trustsource/ts-legalcheck test -l Apache-2.0 -d /data/LicenseConstraints_v4.5.toml /examples/sc01_ProprietarySoftware.toml

NOTE: No extra installation step is required; by executing this command, the ts-legalcheck image is pulled automatically.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ts_legalcheck-1.1.0.tar.gz (128.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ts_legalcheck-1.1.0-py3-none-any.whl (84.3 kB view details)

Uploaded Python 3

File details

Details for the file ts_legalcheck-1.1.0.tar.gz.

File metadata

  • Download URL: ts_legalcheck-1.1.0.tar.gz
  • Upload date:
  • Size: 128.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ts_legalcheck-1.1.0.tar.gz
Algorithm Hash digest
SHA256 8f846240ef547d4865ee35e0f5cb68a4f7458f76c4b2b0cfa53ad252d9e675ae
MD5 c8fcdb73748ec5c3c4b45009042897f5
BLAKE2b-256 2c46549caae84d75d635c989b49155a5bbdd15fd1ab6e0a0b68503840a8c6373

See more details on using hashes here.

File details

Details for the file ts_legalcheck-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: ts_legalcheck-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 84.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ts_legalcheck-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bb14780298bd24aba94e5dacb759e817609f09ef1ce58b0477d9380f7a5970e6
MD5 0e1e37279797d2adb6ccd87354d1f086
BLAKE2b-256 156752b79cb6ae9dc7f36007a4b4e1dfc587d8fe1dcacffe97a4cca5a1d0b06a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page