GrandMoff100 / RegexFactory

Dynamically construct regex patterns with native python representations
https://regexfactory.readthedocs.io
GNU General Public License v3.0
7 stars 4 forks source link

Add License #5

Closed ItsDrike closed 2 years ago

ItsDrike commented 2 years ago

Hi, I noticed that your repository doesn't have a license, which is actually a pretty big issue for everyone forking or perhaps even using your repository.

Why are licenses important

Whenever you publish essentially anything, in this case some code or static content created by you, you automatically gain copyright over that content. This copyright is respected in most developed countries and it imposes big legal restrictions on the content in this repository. Essentially, this means that while you decided to make your software source-available, it is not "open-sourced", because it doesn't have an open source license. This means that while you as the copyright owner allowed others to look at your source, you did not give legal permission to re-use this code or to alter it in any way.

This means that everybody who has forked your repository is actually legally breaking the copyright law. You should really consider adding an open sourced (ideally an FSF approved) license. Doing this will not affect your copyright over the code, it just gives everyone some additional permissions that wouldn't be there without it, a license like this is the only thing that allows others to make derivative projects (projects based on your code), or utilize parts of your code in other places.

License types

Learning about different licenses may be a bit confusing at first, and i would suggest you do your own research. I will describe some basic categories of these licenses and what they mean, but this is NOT a legal advice and again, you should always to your own research. Don't just blindly trust some random guy on the internet.

Copy-Left licenses

These licenses allow others to use your code and built upon it, but they require the use of the same license. This essentially enforces the code to always stay open-sourced as it explicitly forbids sublicensing under any non-copatible license (i.e. a license with different terms).

Most notably, this include the GPL licenses.

Permissive licenses

Permissive licenses give your contributors a lot more freedom because they allow sublicensing. They usually only require stating the original source of the code. This means that if you would decide to use a permissive license, anyone would be able to make a close-sourced project based on your code and even sell it, as long as there is a mention that some parts of this code-base were utilized in it. (If that license requires it)

Most notably, this includes the MIT license and the Apache 2.0 License, another popular set of licenses are the BSD licenses, most notably the BSD 2-Clause license.

Public domain licenses

There are also so called public domain licenses, these licenses are actually a subtype of permissive licenses, however when we talk about permissive licenses, we generally don't really refer to the public domain ones, which is why I separated this category as it is a bit special.

Public domain licenses essentially strip the copyright away and essentially it gives everybody rights to do pretty much anything with the code. They don't require any mentions of the original source for that code and obviously they allow sublicensing. These licenses dont actually "remove" your copyright over that code, they just allow anyome to do anything with the project, essentially disregarding the copyright alltogether.

Most notably, this includes the Unlicense license.

Picking your license

While you aren't required to add a license of any kind, it is a bit weird to have an open-sourced project without any license. At the moment, all of the contributors are actually breaking the copyright law which really isn't ideal. Even though I'm sure you don't have the intention to sue these people, you technically could even though they just wanted to contribute to your project. That's a bit unexpected for the contributors and it could discourage many people from contributing to or even using this project.

Some great websites;

Limitations: While you can license your code under any license whatsoever, if your code is utilizing some copy-left licensed parts (whether by a library-like dependency or directly by having bits of code written by others with that license), you will need to respect the terms of that license and license your code accordingly. This means that if you have a copy-left licensed dependency that you're utilizing in your project, you will need to adhere to it's terms or remove that dependency, otherwise you, as the owner of that code are yourself violating the copyright law by doing something prohibited by copyright and not explicitly allowed by the license of the software you depend on.

My personal preference: In my opinion, to support open-source as much as possible, I usually go with GPL v3, this is because it doesn't allow your code to ever become proprietary since it requires for anyone distributing the software to also distribute the source code and the fulltext of the GPL license along with it. Since it doesn't allow sublicensing, others also can't just use a permissive license and have code from your code-base in those projects, while this may be a bit limiting if someone would like to re-use your project, they can always mark their project as GPL and use the code that way, therefore supporting the open-source community even more.

However for projects made as libraries, pure GPL may be too restrictive for some people since it will limit the amount of total users to only those willing to comply with the GPL license. For that reason whenever I write some code that people may end up importing, I also often choose LGPL, this license acts the same way as basic GPL, but when the code is used as a library, rather than a derivative work, it becomes permissive and allows sublicensing. This allows any project (even proprietary ones) to use your library, but if someone were making a fork of this project, they would have to keep it open-sourced and under LGPL. Note: GPL isn't LGPL compatible which means that if you do use LGPL, you will not be able to use GPLed code anywhere in your code-base.

But of course, this is your decision and everybody can have a different opinion about this.

GrandMoff100 commented 2 years ago

That was very informative. Thank you!

I agree with you, GPL licenses do look like the best license because they prevent exploitation and commercialization of open-source software. Most of my projects tend to be libraries rather than proprietary projects. So for this project and many of my other projects I'm going to add an LGPL/GPL license depending on the dependencies of the project (because of the LGPL/GPL incompatibility).