Licences and open data
Be able to tell CC BY, CC BY-SA, NC and ND apart and decide what may be used commercially.
Prerequisites
Intuition
The Creative Commons building blocks:
| Code | Means | Consequence |
|---|---|---|
| BY | credit the creator | present in every CC licence |
| SA | share-alike | your result has to carry the same licence |
| NC | non-commercial | may not be used commercially |
| ND | no derivatives | may not be changed or built upon |
| CC0 | no copyright left | free use, attribution is polite |
The combinations: CC BY (the freest with attribution) → CC BY-SA (infectious) → CC BY-NC (no commercial use) → CC BY-NC-ND (only share unchanged, non-commercially).
For code other licences apply: MIT and Apache-2.0 (permissive), GPL (copyleft — infectious like SA).
Formal
The traps, in order:
- NC is vague. «Non-commercial» is not defined in detail. A school is usually fine; a paid service is not. Is the platform partly paid for? Then NC material is a risk — which is why AI-grafen has a licence gate that filters out NC content when
PLATFORM_COMMERCIALis set. - SA is infectious. If you build a work on CC BY-SA material, your work also has to be CC BY-SA. That can clash with the rest of the product.
- ND blocks adaptation. You may not cut, summarise or translate it.
- The licence can change for future versions — which is why you record which version you fetched and when (a fingerprint), and check whether the licence has changed.
- No licence = all rights reserved. Something being openly available on the net does not mean it may be used.
Attribution in practice: the title, the creator, the source (a link), the licence (a link) and whether you changed anything. Four lines, every time.
Code
COMMERCIALLY_ALLOWED = {"CC0", "CC BY 4.0", "CC BY-SA 4.0", "MIT", "Apache-2.0", "BSD-3-Clause", "PSF"}
def may_be_used(licence: str, commercial: bool) -> bool:
if not licence:
return False # an unknown licence = no
if "ND" in licence.upper().split("-"):
return False # no adaptation at all
if commercial and "NC" in licence.upper():
return False
return licence in COMMERCIALLY_ALLOWED or not commercial
for lic in ["CC BY 4.0", "CC BY-NC 4.0", "CC BY-ND 4.0", "", "MIT"]:
print(f"{lic or '(none)':16s} commercially: {may_be_used(lic, True)}")
This is exactly the logic behind license_gate() in the platform — and the test that fails if an NC passage ever leaks into the search results.
Mastery means
- Tells CC BY, BY-SA, NC and ND apart
- Decides whether material may be used commercially
- Gives correct attribution
Sign in to do the exercises and build your mastery up.
Sources
- Creative Commons — licenser — CC BY 4.0
- Open Source Initiative — licenser — free to read