Open Source License filter
Open-source licenses filter algorithm library written in TypeScript
Link
- Design document: https://kaiyuanshe.feishu.cn/wiki/wikcnRn5pkE3BSvqFUMkJPymaG3
- UI implement: https://kaiyuanshe.cn/tool/license-filter
Usage
Installation
npm i license-filter
Evaluation
import {
FeatureAttitude,
InfectionRange,
filterLicenses
} from 'license-filter';
const list = filterLicenses({
popularity: FeatureAttitude.Negative,
reuseCondition: FeatureAttitude.Positive,
infectionIntensity: FeatureAttitude.Positive,
infectionRange: InfectionRange.Module,
jurisdiction: FeatureAttitude.Undefined,
patentStatement: FeatureAttitude.Positive,
patentRetaliation: FeatureAttitude.Positive,
enhancedAttribution: FeatureAttitude.Positive,
privacyLoophole: FeatureAttitude.Negative,
marketingEndorsement: FeatureAttitude.Negative
});
console.log(list); // filtered licenses
Design
Evaluation Dimension
- Popularity
- Reuse Condition
- Infection Intensity
- Infection Range
- Jurisdiction
- Patent Statement
- Patent Retaliation
- Enhanced Attribution
- Privacy Loophole
- Marketing Endorsement
Filter Algorithm
-
Mark the weight of various Open-source licenses according to the above Evaluation dimensions:
- Positive
+1
: clearly supports the feature of this dimension - Undefined
0
: no explicit mention of the dimension's feature - Negative
-1
: clearly oppose the characteristics of this dimension
- Positive
-
Input the user's Attitude towards the above dimensional features:
- Positive
+1
: definitely need the feature of this dimension - Undefined
0
: insensitive to the feature of this dimension - Negative
-1
: explicitly reject the feature of this dimension
- Positive
-
Calculate each license by the following formula:
Total weight per license = Dimension weight item x Dimension user attitude value
-
All licenses are ranked in reverse order of the total weight in this screening, which is the result
Project History
Original
http://oss-watch.ac.uk/apps/licdiff/
Old Chinese Edition
Entry
https://kaiyuanshe.cn/license-tool/
Code
- Page: https://github.com/kaiyuanshe/kaiyuanshe.github.io/blob/hexo/themes/Electron/layout/license-tool.ejs
- Logic: https://github.com/kaiyuanshe/kaiyuanshe.github.io/tree/hexo/themes%2FElectron%2Fsource%2FOSLS
New Chinese Edition
Pre-research
https://github.com/luojiyin1987/license-tool
Reference
Standard data
Theoretical research
https://mp.weixin.qq.com/s/ja_w-2NNSIKcO4vv7iN5vg