1- ===============================
1+ ==================
22license-expression
3- ===============================
3+ ==================
44
5- license-expression is small utility library to parse, compare, simplify and normalize
5+ license-expression is a small utility library to parse, compare, simplify and normalize
66license expressions (e.g. SPDX license expressions) using boolean logic such as:
77`GPL-2.0 or later WITH Classpath Exception AND MIT `.
88
9-
109See also for details:
1110https://spdx.org/sites/cpstandard/files/pages/files/spdxversion2.1.pdf#page=95&zoom=auto
1211
1312license: apache-2.0
1413
1514Python: 2.7 and 3.4+
1615
17-
1816Build and tests status
1917======================
2018
21- +-------+-------------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+
22- | Branch | **Linux (Travis) ** | **MacOSX (Travis) ** | **Windows (AppVeyor) ** |
23- +=======+===============================================================================+===============================================================================+=============================================================================================================+
24- | |.. image:: https://api.travis-ci.org/nexB/license-expression.png?branch=master |.. image:: https://api.travis-ci.org/nexB/license-expression.png?branch=master |.. image:: https://ci.appveyor.com/api/projects/status/github/nexB/license-expression?svg=true |
25- | Master | :target: https://travis-ci.org/nexB/license-expression | :target: https://travis-ci.org/nexB/license-expression | :target: https://ci.appveyor.com/project/nexB/license-expression |
26- | | :alt: Linux Master branch tests status | :alt: MacOSX Master branch tests status | :alt: Windows Master branch tests status |
27- +-------+-------------------------------------------------------------------------------+-------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+
19+ +-------+-------------------------------------------+--------------------------------------------+---------------------------------------------+
20+ | Branch | **Linux (Travis) ** | **MacOSX (Travis) ** | **Windows (AppVeyor) ** |
21+ +=======+===========================================+============================================+=============================================+
22+ | |.. image:: travis-master-icon_ |.. image:: travis-master-icon _ |.. image:: appveyor-master-icon_ |
23+ | Master | :target: travis-master-link _ | :target: travis-master-link _ | :target: appveyor-master-link _ |
24+ | | :alt: Linux Master branch tests status | :alt: MacOSX Master branch tests status | :alt: Windows Master branch tests status |
25+ +-------+-------------------------------------------+--------------------------------------------+---------------------------------------------+
26+
27+ .. _travis-master-icon : https://api.travis-ci.org/nexB/license-expression.png?branch=master
28+ .. _travis-master-link : https://travis-ci.org/nexB/license-expression
29+
30+ .. _appveyor-master-icon : https://ci.appveyor.com/api/projects/status/github/nexB/license-expression?svg=true
31+ .. _appveyor-master-link : https://ci.appveyor.com/project/nexB/license-expression
2832
2933
3034Source code and download
@@ -42,6 +46,7 @@ Submit bugs and questions at:
4246
4347Description
4448===========
49+
4550This module defines a mini language to parse, validate, simplify, normalize and
4651compare license expressions using a boolean logic engine.
4752
@@ -53,11 +58,12 @@ equivalence and can be normalized or simplified.
5358
5459The main entry point is the Licensing object.
5560
56-
5761Usage examples
5862==============
5963
60- For example::
64+ For example:
65+
66+ .. code-block :: python
6167
6268 >> > from license_expression import Licensing, LicenseSymbol
6369 >> > licensing = Licensing()
@@ -89,15 +95,17 @@ For example::
8995 >> > assert expected == licensing.license_symbols(parsed)
9096 >> > assert expected == licensing.license_symbols(expression)
9197
98+ And expression can be simplified:
9299
93- And expression can be simplified::
100+ .. code-block :: python
94101
95102 >> > expression2 = ' GPL-2.0 or (mit and LGPL 2.1) or bsd Or GPL-2.0 or (mit and LGPL 2.1)'
96103 >> > parsed2 = licensing.parse(expression2)
97104 >> > assert str (parsed2.simplify()) == ' BSD OR GPL-2.0 OR (LGPL 2.1 AND mit)'
98-
99105
100- Two expressions can be compared for equivalence and containment::
106+ Two expressions can be compared for equivalence and containment:
107+
108+ .. code-block :: python
101109
102110 >> > expr1 = licensing.parse(' GPL-2.0 or (LGPL 2.1 and mit) ' )
103111 >> > expr2 = licensing.parse(' (mit and LGPL 2.1) or GPL-2.0 ' )
@@ -117,11 +125,10 @@ Two expressions can be compared for equivalence and containment::
117125 >> > licensing.contains(expr2, expr4)
118126 True
119127
120-
121128 Development
122129===========
123130
124131* Checkout a clone from https://github.com/nexB/license-expression.git
125- * Then run `./configure ` (or `configure.bat `) and then `source bin/activate `. This will
132+ * Then run `` ./configure `` (or `` configure.bat `` ) and then `` source bin/activate ` `. This will
126133 install all vendored dependencies in a local virtualenv, including development deps.
127- * To run the tests, run `py.test -vvs `
134+ * To run the tests, run `` py.test -vvs ` `
0 commit comments