Skip to main content

No project description provided

Project description

scarfer

Source code scan report file reporter

Introduction

Scarfer outputs compliance related information from a scan report.

A scan report contain lots of information, for example Scancode has 37 entries on the top level for each file, about a file and it is sometimes cumbersome to open with an editor to extract the information wanted. Scarfer provides a quick command line access to scan reports.

Features

Scarfer can output the following information per file:

  • copyright (using -c)

  • license (using -l)

  • text that caused the license detection (-m)

Scarfer can output the following summaries

  • license summary (using -ls)

  • copyright summary (using -cs)

Filter

Scarfer can filter files:

  • include files with:

    • license name (-il) using Python's regular expressions

    • files (-if) using Python's regular expressions

    • files (-iff) by reading a file, containing file names, using Python's regular expressions

    • copyright (-ec) using Python's regular expressions

  • exclude files with:

    • license name (-el) using Python's regular expressions

    • files (-ef) using Python's regular expressions

    • files (-eff) by reading a file, containing file names, using Python's regular expressions

    • copyright (-ec) using Python's regular expressions

Note: if you're using more than one filter then filters are AND:ed together

Curate

Scarfer can curate (fix, amend) license identifications:

  • curate license (-cml) for all files with missing license

  • curate license (-cfl) for all files matching Python's regular expressions

Configuration file

Scarfer can write and read configuration files:

  • output current (-oc) command line options to a configuration output

  • read configuration file (--config)

Example use

Output the file names (full path) of all the files in the Scancode report example-data/cairo-1.16.0-scan.json:

$ scarfer example-data/cairo-1.16.0-scan.json 

As above but output only files with path matching drm:

$ scarfer example-data/cairo-1.16.0-scan.json -if drm

Output the file names (full path) of all the files in the Scancode report example-data/cairo-1.16.0-scan.json with a license matching gpl-3:

$ scarfer example-data/cairo-1.16.0-scan.json -il gpl-3

Output the file names (full path) of all the files in the Scancode report example-data/cairo-1.16.0-scan.json with a license matching mpl and files with path matching drm. The output should also contain information (per file) about license and copyright:

$ scarfer example-data/cairo-1.16.0-scan.json -il mpl -if drm -c -l 

To filter in all files containing "/*pdi" and ending with ".c":

$ scarfer example-data/cairo-1.16.0-scan.json -if "/.*pdi.*\.c$"

To filter out all files containing "/*pdi" and ending with ".c":

$ scarfer example-data/cairo-1.16.0-scan.json -ef "/.*pdi.*\.c$"

Supported scan report formats

  • Scancode Toolkit, version 21 and upwards

  • Scancode Output Format version 1.0.0, 2.0.0, 3.0, 3.2, 4.0, 4.1.0

Hints on source code scanners

Scancode 32.0*

Assuming you want to scan a directory called cairo and store the output in cairo-scan.json:

scancode -clipe \
  --license-text   --license-text-diagnostics        \
  --classify       --license-clarity-score --summary \
  -n $(cat /proc/cpuinfo | grep processor | wc -l)   \
  --json-pp cairo-scan.json cairo

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

scarfer-0.5.8.tar.gz (28.6 kB view details)

Uploaded Source

Built Distribution

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

scarfer-0.5.8-py2.py3-none-any.whl (29.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file scarfer-0.5.8.tar.gz.

File metadata

  • Download URL: scarfer-0.5.8.tar.gz
  • Upload date:
  • Size: 28.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for scarfer-0.5.8.tar.gz
Algorithm Hash digest
SHA256 2d124fc6bfbe756671b0f9df5d2ada422e0d04df395989e6e981b131ebea1d38
MD5 a1698222724b6c2cc49d5a543fbd4d19
BLAKE2b-256 1314fee5fd43ef2e660b406e1330a418fbf52326f73ef2994ae326be831a7009

See more details on using hashes here.

File details

Details for the file scarfer-0.5.8-py2.py3-none-any.whl.

File metadata

  • Download URL: scarfer-0.5.8-py2.py3-none-any.whl
  • Upload date:
  • Size: 29.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for scarfer-0.5.8-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 47aac0c870ed53589e78193af5b4dc6e73a771d65fd48c48ca473c92670ebe2b
MD5 f403653c35a210405ffe939134e08634
BLAKE2b-256 faf68b4294160e201584008be22bec3b5751eb31d48ad5cd4f3c8147feabcdcc

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