4

Is there some web page or Unix command line tool where I can paste the text of a license, and it would match it against a database of well-known open source licenses to tell me which one it is?

For example, the SPDX project already has an excellent database, I'm just looking for an easy front-end for this purpose.

Lassi
  • 179
  • 4
  • 1
    The usual problem isn't identifying the licence given the text, it's finding some kind of licence declaration in the first place. Do you have working examples of licences which are clear, but you can't tell which licence they are? – MadHatter Jul 21 '19 at 09:05
  • Thank you for asking. I can tell what they are, but to do so I have to manually read word-for-word and cross-check with license templates (or use standard diff which is clumsy for this task). I can't reliably tell the difference between the various permissive licenses (MIT, BSD, etc.) from memory without manually comparing to a template. When incorporating 3rd party code into my own project I like to compare the license texts word-for-word to make sure there are no surprises. So I can already do everything I need but it's slow and error-prone. – Lassi Jul 21 '19 at 10:06
  • I repeat my question: can you give us a real-world example of code which contains a clear licence that cannot be identified by simple inspection? – MadHatter Jul 21 '19 at 10:08
  • The (main) issue is not ambiguity but how fast and convenient license identification is for a human. I'm not any good at reading and memorizing legal text. I'd much rather copy-paste the LICENSE file into some tool and have it say "this it MIT" or "this is almost equal to MIT but that phrase over there is custom". – Lassi Jul 21 '19 at 10:15
  • 5
    GitHub uses the Licensee tool (written in Ruby) to determine project licenses. – amon Jul 21 '19 at 10:36
  • 1
    Licensee is just what I was looking for (even better in fact, since it can find LICENSE/COPYING/etc. files in the current directory by itself). For license files with custom text it even lets you do things like licensee diff COPYING --license MIT which makes it say Similarity: 95.29% and show the diff. This used to take minutes of tedious work, now it takes a few seconds and does a more reliable comparison than I could do myself. Perfect. – Lassi Jul 21 '19 at 10:51
  • 3
    @amon I guess this should be an Answer. – Brandin Jul 22 '19 at 05:17
  • 1
    It's a great answer. I know "recommend a tool" questions are frowned upon but I couldn't figure out how else to phrase it. – Lassi Jul 22 '19 at 07:57

1 Answers1

6

In order that this question can have an answer accepted, but given that Amon doesn't seem minded to write it, I'm repeating his/her answer verbatim as community wiki. Amon, if you do want to write it up, flag me or a mod to remove this answer.

GitHub uses the licensee tool, which is written in Ruby, to determine project licences.

MadHatter
  • 48,547
  • 4
  • 122
  • 166