Feed Sign in with OpenID OpenID

Simon Willison’s Weblog

Open source license help needed

Every now and then, I get an e-mail asking me to clarify the license associated with code that I’ve posted on this site, such as my date parsing script. I’m looking for an open source license that I can start slapping on things to ensure people that they can use it for whatever they want, but wading through the list of licenses is no fun at all. Here are the features I’m looking for:

  • Minimal boiler-plate. I don’t want to have to copy and paste dozens of lines of legalese in to a 30 line long example script; my ideal license would allow me to “link it in” in a single line (“(c) Simon Willison 2004, released under [X] license”).
  • Allows commercial use. I don’t care if people make money off something I’ve published here.
  • Encourages attribution. I don’t want people feeling they have to credit me if they reuse five lines of Python I posted as an example somewhere, but I’m not averse to getting credited for more substantial contributions. I don’t want to make attribution a requirement though as I’d rather people used my code and failed to attribute me than didn’t use it at all.
  • Is compatible with other licenses. I often get asked if people can include my code in other open source projects—whatever license I use needs not to get in the way of other people’s licensing aims for their own projects.

I’m tempted to just slap a note saying “this code is in the public domain” on everything and have done, but I’m not sure if there are unpleasant side effects to doing so. The only thing I want to avoid is people explicitly claiming my work as their own.

This is Open source license help needed by Simon Willison, posted on 5th November 2004.

View blog reactions

Next: Usability blunders

Previous: Let a thousand conspiracy theories bloom

42 comments

  1. Hmm, I've been pondering the same thing myself.

    Have you considered releasing code under one of the Creative Commons licenses? It's quite possible to do so, and you can mix and match the requirements to your liking. If you don't specify "ShareAlike" then it's probably pretty compatible with other licenses too, although don't take my word for it.

    Otherwise, it sounds like you're looking for a variant of the BSD license. It's reasonably minimal compared to other licenses, allows commercial use, and requires attribution in source code only. Plus it's one of the most compatible software licenses. Don't be put off by the legalese warranty disclaimer though; it's a smart idea to have that in there in case some company adopts your code then decides to sue if it turns out to have an error of some kind (they'd probably get thrown out of court, but I doubt you want the experience!)

    Angus Turnbull - 5th November 2004 01:25 - #

  2. Why not just release your work under a Creative Commons license? I've seen other software released using CC as their sole license and they seem to do fine. Is there something I'm missing?

    Jason Cosper - 5th November 2004 01:25 - #

  3. It's not legalese I'm against; it's legalese boiler-plate. I don't want to have to paste any more than a line or two of "stuff" in to any file which I wish to license. I don't mind if the full license is a lot longer, provided I can reference it rather than quoting it in its entirity every time I use it.

    Creative Commons is definitely an option, but only if it's fully compatible with other licenses.

    Simon Willison - 5th November 2004 01:43 - #

  4. Perhaps the MIT license will work for you: http://www.opensource.org/licenses/mit-license.htm l. http://www.opensource.org/licenses/ is probably the best source for picking a license.

    Jason Luther - 5th November 2004 01:44 - #

  5. The MIT licence (http://www.opensource.org/licenses/mit-license.ph p) is about as short as they come short of just public domaining everything.

    Thomas Goyne - 5th November 2004 01:46 - #

  6. The OpenBSD license is nice and simple.

    Daniel Neri - 5th November 2004 01:51 - #

  7. MIT license was mentioned above, that's a good one. BSD license is pretty close to what you want. Apache 2 license is a BSD derivative that is pretty close to BSD. Perl's Artistic License is also nice and open.

    George Schlossnagle - 5th November 2004 01:54 - #

  8. the creative commons folks explicitly discourage using the creative commons licenses for software, as they were not written with such usage in mind.

    for this sort of thing, i usually use the mit license. simple and straightforward.

    jim winstead - 5th November 2004 01:57 - #

  9. Much of the length of the permissive licenses are in disclaiming a warrantee. This is legally quite important in the US, but I don't know how it is elsewhere. Probably just as important, but the actual wording might not match well. OTOH, if it's outside of your country, it's highly unlikely anyone would pursue you. I think you can whatever permissive license you like, and put a note just after that says "This is the X license (BSD, MIT, etc, with a link to an explanation); the author (Simon Willison) would appreciate but does not require acknowledgement."

    Ian Bicking - 5th November 2004 02:33 - #

  10. What about the wxWindows license?

    AlexH - 5th November 2004 02:56 - #

  11. The Artistic License

    J$ - 5th November 2004 04:03 - #

  12. You want a BSD-style license, such as http://opensource.org/licenses/bsd-license.php or http://opensource.org/licenses/mit-license.php .

    Don't use a Creative Commons license; they are not DFSG-free (Debian Free Software Guidelines). Software licensed under CC licenses can not be included in Debian.

    Mark - 5th November 2004 04:06 - #

  13. If you are dedicating your work to the public domain, you should read some disclaimers, like the creative commons certification or this interesting result from googling for "problems with public domain". The CC's approach is very intersting. Simply complete their dedication form and add their code:

    <!-- Creative Commons Public Domain -->

    <a rel="license" href="http://creativecommons.org/licenses/publicdo main/"><img alt="Public Domain Dedication" border="0"

    src="http://creativecommons.org/images/public/nori ghts-a.gif" /></a><br />

    This work is dedicated to the

    <a rel="license" href="http://creativecommons.org/licenses/publicdo main/">Public Domain</a>.

    <!-- /Creative Commons Public Domain -->

    <!--

    <rdf:RDF xmlns="http://web.resource.org/cc/"

    xmlns:dc="http://purl.org/dc/elements/1.1/"

    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax -ns#">

    <Work rdf:about="">

    <dc:title>Thoughts about the Public Domain</dc:title>

    <dc:rights><Agent>

    <dc:title>James Francis Cerra</dc:title>

    </Agent></dc:rights>

    <license rdf:resource="http://web.resource.org/cc/PublicDom ain" />

    </Work>

    <License rdf:about="http://web.resource.org/cc/PublicDomain ">

    <permits rdf:resource="http://web.resource.org/cc/Reproduct ion" />

    <permits rdf:resource="http://web.resource.org/cc/Distribut ion" />

    <permits rdf:resource="http://web.resource.org/cc/Derivativ eWorks" />

    </License>

    </rdf:RDF>

    -->

    From Step 3 in Choose License | Creative Commons.

    Dean Edwards often licenses stuff, such as CSSQuery under another creative commons license, so you can use his source as a guide (that's fair use!).

    P.S. This work - "Thoughts about the Public Domain" - is dedicated to the Public Domain. :-)

    Jimmy Cerra - 5th November 2004 04:27 - #

  14. I use the MIT license for all my stuff. My standard blurb explaining what that means is... In plain English, that means you can do whatever you want with the software, including modifying it, selling it, or eating it, but we�re not responsible for anything that goes wrong.

    Adam Kalsey - 5th November 2004 05:38 - #

  15. I have the same problem/question currently. After the 3-clause (and sometimes 2-clause) move, the BSD license is almost the same with the MIT. I use the BSD license mostly (2-clause). It's the shortest you can get (I think) without going into public domain (where you can have one line or so). Whatever license you use, it is a good idea to include it in the source file, and not just say it exists somewhere. Hope this helps.

    Aggelos - 5th November 2004 08:10 - #

  16. As a data point, all my scripts are MIT-licenced.

    Stuart Langridge - 5th November 2004 08:11 - #

  17. You could also release it to the public domain. It is the free-est of all, meaning you do not wish to retain any rights to it. Chui

    Chui Tey - 5th November 2004 08:19 - #

  18. I tend to use the BSD-style or PHP license and link to the webpage of the said license e.g.:

    * @license http://www.php.net/license/3_0.txt

    I think that there may be pydoc which you can use to do similar.

    Jacques - 5th November 2004 09:32 - #

  19. It looks like you want the zlib-license: http://www.gzip.org/zlib/zlib_license.html

    Carl - 5th November 2004 10:46 - #

  20. The The MIT License seems straight forward and some of the others mentioned later were probably more like what you were after perhaps you'll have to take the best points from a few of them.

    Robert Wellock - 5th November 2004 11:43 - #

  21. According to the FSF the "MIT" license is better refered to as the "X11" license, since MIT has used many different licenses for different software. But yes, this seems like a good choice, with an added "Attribution optional, but appreciated." clause.

    Also, I used your getElementsBySelector function, but managed to forget to send you a thank you. At least I included a link in the source.

    Jan Soderback - 5th November 2004 15:21 - #

  22. The Beerware License by Poul Herning Kamp is always great :). http://people.freebsd.org/~phk/

    Jonathan - 5th November 2004 16:44 - #

  23. Provided I can figure out a way to cram the beerware license in to three lines it will suit me down to the ground! Does anyone know if it's likely to conflict with other licenses people might be using?

    Simon Willison - 5th November 2004 22:18 - #

  24. I am extremely surprised that no one has as of yet mentioned the GPL.

    I feel like I owe it to the world at large, and RMS of course, to suggest it as a licence.

    The GNU General Public License (GPL) is perhaps one of Richard Stallman's momentous contributions to the Free Software movement.

    In it's simplest terms it locks software into a form of communal ownership. Once locked, all derivative versions must carry the same licence. This ensures that whatever code you write starts free and stays free.

    It's not just about "open source" it's about freedom.

    If you released it into the public domain there would be nothing stopping someone from taking that code and re-releasing it in a non-free manner.

    I highly recommend you use the GPL.

    Noah Slater - 5th November 2004 23:48 - #

  25. The GPL is overkill for 90% of what it is used for.

    Aquarion - 6th November 2004 11:23 - #

  26. I don't want to use the GPL because it can discourage my code being used in commercial projects. Remember, I'm after a license to put on simple example scripts posted on this blog. If I was releasing a larger application I might consider the GPL, but for examples which I actively want people to reuse where-ever they want to it's just too restricting.

    Simon Willison - 6th November 2004 13:36 - #

  27. I'm no license guru, but perhaps the LGPL is what you're looking for?

    Ben Pirt - 7th November 2004 10:44 - #

  28. I use the MIT license for all my scripts.. you might want to give it a try ~ Becky

    Rebecca - 8th November 2004 05:54 - #

  29. Why not write somewhere "please feel free to use this code for any purpose you like, credit me if you wish" rather than bothering with what I see as a waste of time for a free-to-use licence

    Smiler - 8th November 2004 15:05 - #

  30. FWIW, Andrew M. St. Laurent, author of Understanding Open Source and Free Software Licensing has a series of articles on just this topic on OnLAMP. The first part covers GNU Free Documentation License. In addition, chapter 2 of his book, is a available for free from the O'Reilly website "The MIT, BSD, Apache, and Academic Free Licenses" (pdf). Part two of the series covers Open Publication Licenses such as Open Content and the Creative Commons.

    Tom Keays - 8th November 2004 16:04 - #

  31. Other commenters noted that the Creative Commons licenses are not intended for software. They also do not meet the Debian Free Software Guidelines, which you should keep in mind if you think your software (or anything based on it) should ever be included in Debian. I agree with the other posts suggesting the MIT License or simply release your work to the public domain. If you choose the public domain, you can include a simple one-sentence statement of that fact in the code, plus a link to the Creative Commons Public Domain Deed (which should satisfy any lawyers vetting your code for potential legal problems).

    Matt Brubeck - 8th November 2004 16:59 - #

  32. I was wondering if there was a similar license except without commercial use?

    Rad Smith - 9th November 2004 21:47 - #

  33. It's 13 lines of boilerplate, but the BSD short-form license is a pretty nice one. It allows any use, commerical or otherwise, as long as the original copyright is preserved.

    If I ever get around to releasing any code, I'll probably use this license.

    Jacob - 10th November 2004 04:52 - #

  34. I would avoid the GPL.

    Use BSD or MIT or another license that doesn't force a world viewpoint on user's who would use your code in other projects.

    The GPL and LGPL carry a lot of encumberance. Many if not most GPL projects aren't in compliance with the license, and it restricts your options in terms of libraries you can use and platforms that you can target.

    Some platforms don't allow redistribution of source code that links to their API.

    It's really best to use BSD or MIT. These licenses basically say that anyone who uses your library has to give you credit, can't use your name in advertising, and has to keep your copyrights intact if they choose to redistribute the code.

    What it doesn't do (that GPL does) is force anyone who uses your code to provide a copy of it on request, for not more than the cost of the media, nor force any license on people who choose to use your code in other projects (they're allowed the right to cover their code using any license that they would like).

    Dave Bacher - 10th November 2004 19:48 - #

  35. Have you come to a decision yet? :)

    Yar Hwee Boon - 13th November 2004 05:29 - #

  36. The only thing I want to avoid is people explicitly claiming my work as their own.

    Now, I'm not a lawyer. But if the above is all you need, wouldn't just pasting that line in your code solve your problem? Call it the Simon Willison's License (SWL) if you like.

    Wieland - 15th November 2004 14:01 - #

  37. In reference to the BSD, MIT, et al that grant commercial use of my code: I would like the authors of derivitive works to be able to apply a new, different copyright and not lose their proprietary rights because I previously usurped them. It seems all the copyrights enforce their own replication. Is Public Domain the only way to grant cut-and-paste users ownership rights of their derivitive work? John

    John Sinclair - 5th December 2004 15:19 - #

  38. +1 for MIT license; I use it for all my stuff and it's the shortest 'full' license I could find.

    Phillip Pearson - 14th December 2004 01:02 - #

  39. I visited here through Yahoo.com and It refered me that you might have information on a possible cure for cancer. If you have any Health Information leading to the possible cure for cancer, could someone let me know where they hear

    Health Information - 2nd January 2005 13:18 - #

  40. Developers have always traded code with one another and posted examples for less skilled or experienced developers to learn from. However in the face of increasing outsourcing offshore and a cooling of the global economic climate. I advise you people not to contribute to Open Source project but rather focus on your own locked down licensed product based development and personal code libraries. The point is that you can always give away commercial code. However, if you don't control your own work your only weakening you own hand.

    The Technology sector is not managed properly and is not a profitable industry because Business is used to receiving IT services on the cheap.

    In the past as a tutorial writer I posted quite a bit of code under the MIT licence and will continue to use this lincence in the near future. If you right a short script or application that you don't mind being reused in commercial projects or are training people then it's best in my opinion to go for the MIT or place the code public domain.

    • The LGPL allows for redistribution and sale of bespoke solutions based on source code.
    • The GPL on the other hand restricts the reuse of source code to use within other open source projects.

    The GPL does not work and is widely violated by the software industry and I have worked on several commercial projects, that where unlawfully based on GPL source code. Whilst their is still genuine confusion amongst IT decision makers as to the implications of using GPL source. This type of abuse is widespread and has caused many organisations to avoid the use of GPL source code altogether.

    Gregory Boshoff - 16th May 2005 01:57 - #

  41. As for the boiler plate maybe you could say something like this: (c) year, Simon Incutio, released under GPL as per: http://www.gnu.org/copyleft/gpl.html

    Martijn - 25th October 2005 10:20 - #

  42. As a copyright owner, you can relicense your code whenever you want and even give multiple lincenses to it.

    tommi - 5th September 2006 21:08 - #

Comments are closed.

Previously hosted at http://simon.incutio.com/archive/2004/11/05/licensing