Coverage for api/constants/licenses.py: 100%

7 statements  

« prev     ^ index     » next       coverage.py v7.15.2, created at 2026-10-07 06:14 +0000

1# This differs from the frontend which does not consider CC0 as a CC license 

2CC_LICENSES = {"by", "by-sa", "by-nd", "by-nc", "by-nc-sa", "by-nc-nd", "cc0"} 

3 

4DEPRECATED_CC_LICENSES = {"sampling+", "nc-sampling+"} 

5 

6PUBLIC_DOMAIN_MARKS = {"cc0", "pdm"} 

7 

8ALL_CC_LICENSES = CC_LICENSES | DEPRECATED_CC_LICENSES 

9 

10ACTIVE_LICENSES = PUBLIC_DOMAIN_MARKS | CC_LICENSES 

11 

12ALL_LICENSES = ACTIVE_LICENSES | DEPRECATED_CC_LICENSES 

13 

14LICENSE_GROUPS = { 

15 # All available licenses and marks 

16 "all": ALL_LICENSES, 

17 # All CC licenses 

18 "all-cc": ALL_CC_LICENSES, 

19 # All licenses allowing commercial use 

20 "commercial": {_license for _license in ALL_LICENSES if "nc" not in _license}, 

21 # All licenses allowing creation of derivative works 

22 "modification": {_license for _license in ALL_LICENSES if "nd" not in _license}, 

23}