Registry / testing / license-header-check

license-header-check

JSON →
library0.2.1pypypiunverified

A Python tool to check that source files have a license header. It scans files for a given regex pattern and reports files missing the header. Current version 0.2.1, released irregularly.

pip install license-header-check
INSTALL
IMPORT
SIG · LICENSE-HEADER-CHE
L
license-header-check
testingpythonv0.2.1
Install
1.5s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.2.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 17.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.5s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

LicenseHeaderCheck
from license_header_check import LicenseHeaderCheck
from license_header_check import LicenseHeaderCheck

Create a checker instance, run check on current directory for Python files, ensuring they contain the SPDX MIT header.

from license_header_check import LicenseHeaderCheck checker = LicenseHeaderCheck('.', patterns=['\.py$'], comment='#') missing = checker.check(headers=['# SPDX-License-Identifier: MIT']) print('Missing headers in:', missing)
license-header-check --version
Debug
Known issues
gotchaThe `check` method returns a list of file paths missing the header, not a boolean. Do not use `if checker.check(...):` expecting True/False.
fix
Use `if len(missing) > 0:` or `if missing:`.
affects: all
gotchaThe `headers` parameter must be a list of strings. Passing a single string will iterate over characters.
fix
Wrap in list: `headers=['# License ...']`.
affects: all
Upgrade
Version history
0.2.1latest on PyPI · released Nov 16, 2021
Audit
Dependencies

No dependency data recorded yet.

Agent activity
15 hits · last 30 days
node
14
Amazon
1
Resources