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:
| Permissive (MIT, Apache 2.0, BSD) | Copyleft (GPL) | |
|---|---|---|
| Use, change, share | Yes | Yes |
| Main condition | Keep the copyright and licence notice | If you share copies or changed versions, share them under the GPL too, with source code |
| Can be used in closed-source software | Yes | Not when you distribute the combined program |
| The idea | Maximum freedom for whoever uses the code | Keep 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
Use an MIT-licensed library inside Pila
Change a GPL-licensed program and give copies of it to other barangays
Copy a function from a public repository that has no licence file
Run a GPL-licensed tool on the team’s own computers
Use pytest (MIT licence) to test Pila
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:
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.
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
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
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.
- Open Source Initiative: The MIT License: the full text, and a short permissive licence
- GNU General Public License, version 3: the best-known copyleft licence
- Choose a License: a plain guide to choosing an open source licence, from GitHub
- GitHub Docs: Licensing a repository: including what happens with no licence
- Republic Act No. 8293, the Intellectual Property Code of the Philippines (The LawPhil Project): copyright, including computer programs