Reproducible Research › Module 6: Sharing

Licences: code and data

Lesson 1 of 3 · 2 min

Previous

If you share code or data without a licence, the law in most countries treats it as "all rights reserved": others can look, but can't legally reuse it. A licence gives permission.

Common code licences

MIT
In short: Do almost anything; keep the copyright notice. Very common, very simple.
Apache 2.0
In short: Like MIT, plus an explicit patent grant.
GPL v3
In short: Free to use and change, but shared changes must also be GPL ("copyleft").

Common data and text licences (Creative Commons)

CC0
In short: No rights reserved; public domain.
CC BY 4.0
In short: Reuse freely, with credit. Common for open-access papers and data.
CC BY-NC
In short: Reuse with credit, non-commercial only.

Creative Commons recommends not using its licences for software; use a software licence for code.

How to add one

  1. Choose (choosealicense.com helps).
  2. Add a LICENSE file at the top of your repo.
  3. Say it in the README: "Code: MIT. Data: CC BY 4.0."

Check what you're allowed to share

You can only license what you have the right to. Data from others, like a dataset under CC BY-NC, or data with personal information, comes with its own conditions you must follow.

RememberNo licence means no permission. Pick one for code (like MIT) and one for data (like CC BY 4.0), and say so in the README.