Quality, safety and people · lesson 5 of 8
Ideas in this lesson
ACopyrightautomatic: the author owns their code
BPermissive (MIT)reuse freely; keep the notice
CCopyleft (GPL)share changes under the same licence

Licences and open source

Last updated

Pila is built on other people's code: Python, its web framework, pytest, and dozens of libraries. Each comes with a licence that says what you may do with it. And other barangays now want to use Pila, so the team has to choose a licence of its own. In this lesson you'll learn why code with no licence isn't free to copy, how permissive and copyleft licences differ, and how to choose one.

By the end of this lesson you can

  • Explain why code with no licence can’t simply be reused
  • Tell permissive licences like MIT from copyleft licences like the GPL
  • Check the licences of a project’s dependencies

No licence means no permission

In the Philippines, as in most countries, the Intellectual Property Code (Republic Act 8293) protects computer programs by copyright, and copyright exists from the moment a work is created. You don't have to register it or write “©”.

So code you can see isn't code you may use. A repository on GitHub with no licence is, by default, “all rights reserved”: you can read it, but copying, changing or sharing it needs the author's permission. A licence is that permission, written down in advance for everyone.

This lesson is a summary for learning, not legal advice. Organisations have lawyers for the hard cases.

Permissive and copyleft

Open source licences let anyone use, study, change and share the code. They come in two main families:

Two families of open source licence
Permissive (MIT, Apache 2.0, BSD)Copyleft (GPL)
Use, change, shareYesYes
Main conditionKeep the copyright and licence noticeIf you share copies or changed versions, share them under the GPL too, with source code
Can be used in closed-source softwareYesNot when you distribute the combined program
The ideaMaximum freedom for whoever uses the codeKeep the code, and everything built from it, free for everyone

Neither is better. They make different promises. Projects pick permissive licences to be used as widely as possible, and copyleft to make sure improvements are shared back.

What may Pila do?

0 of 6 placed right

  1. Use an MIT-licensed library inside Pila

  2. Change a GPL-licensed program and give copies of it to other barangays

  3. Copy a function from a public repository that has no licence file

  4. Run a GPL-licensed tool on the team’s own computers

  5. Use pytest (MIT licence) to test Pila

  6. Use a library whose licence says “non-commercial use only” in a paid version of Pila

Teams check their dependencies' licences with tools, because a project can have hundreds. In Python, pip-licenses lists them:

pila
pip-licenses --format=plain
 Name        Version  License
 Flask       3.1.0    BSD License
 pytest      8.4.1    MIT License
 requests    2.32.4   Apache Software License
 ruff        0.12.3   MIT License

Choosing Pila’s licence

Other barangays want to run Pila for their own health centres. Kap. Ernesto asks what licence the barangay should use.

The barangay wants any town to be able to use and improve Pila, and wants improvements to come back to everyone, not into a private product. Which fits better?

Whichever is chosen, it goes in a LICENSE file at the top of the repository. Sites like choosealicense.com explain each option in plain words, and GitHub offers the common licences when you create a repository.

Spot the trap: code with no licence

Spot the trapMarco

Marco finds a neat function for formatting Philippine phone numbers in a repository with no licence file. “It’s public on GitHub,” he says, and pastes it into Pila.

What happens if…

Check what you learned

A public repository has no licence. May you copy its code into your project?
What is the main condition of the MIT licence?
What does copyleft mean?

Sources

Every claim on this page comes from these sources: the standard, the founding text of a method, a study, or the official record of a project, from the body that publishes it. Industry reports are labelled as such.

All sources for Simple Software Development