raimon49 / pip-licenses

Dump the license list of packages installed with pip.
MIT License
307 stars 43 forks source link

Ignore case when matching license names #145

Closed khatkar closed 1 year ago

khatkar commented 1 year ago

Does it make sense to match license names ignoring the case? For the flags --allow-only and --fail-on, currently the user has to provide all case combinations which feels redundant. For example,

$ pip-licenses
Name      Version   License
PIMS      0.5       BSD-3-clause
protobuf  3.20.1    BSD-3-Clause

Now running pip-licenses --allow-only "BSD-3-Clause" will fail for the pims package. So the user has to set --allow-only "BSD-3-Clause;BSD-3-clause". If the user maintains a list of allow-only or fail-only licenses as part of their code, long term stability of such code is affected as new case combinations come up. It'd be nice if we can support case-insensitive matching.