I invested a considerable amount of time translating a set of Matlab scripts into Python and subsequently conducted extensive testing to ensure that the Python scripts returned the exact same values/parameters as their original Matlab counterparts. Later, I discovered that these scripts were published under the CC BY-NC-ND 4.0 license (Attribution-NonCommercial-NoDerivs 4.0 International), which prohibits me from sharing my Python version. Specifically, the 'no derivative' clause states that:

If you remix, transform, or build upon the material, you may not distribute the modified material.

Is there a way I can package my code, or is there any notice or warning I can include that would allow me to publish my code?


2 Answers 2


I'm afraid the answer's not what you want to hear. You may of course approach the original rightsholder(s) and ask for permission, but barring that, you made the mistake of not checking the licence on the work you were adapting, and now you're paying for it.

There is no magic incantation or other form of verbiage that will permit you to infringe the original rightholder's copyright with impunity; if there were, everybody would be doing it. Sorry to be the bearer of bad news.

  • You are probably right. I beleive the best way to share my code is to get my work approuved and published by the authors of the original code. However, I'm afraid they might not want to maintain an additional version of their work.
    – papaya
    Commented Apr 3 at 14:15
  • 4
    @papaya they don't need to host, publish, or be responsible for your version: they only need to give you permission to publish it (and they should make clear what licence terms you are permitted to do this under). By the way, local etiquette is that you accept an answer you're happy with by clicking on the "tick" outline next to it, which drives the reputation system both for you and the author of the answer, and makes clear no further answers are sought. My apologies if you already know this.
    – MadHatter
    Commented Apr 3 at 14:38
  • 1
    But do ask them: if you make it clear to them that you're not expecting them to do any maintenance work, they might say yes! It's commonly understood that CC is not designed for code, so there's a decent chance it simply hasn't occurred to the authors that anyone might want to use their scripts. Commented Apr 4 at 15:04

If your Python version takes only the mathematical ideas and algorithms from the original, and none of the creative side, it is not a derivative work.

The problem is that this is difficult to prove in either direction in court. The classic way to prove it is clean-room design where an intermediate document is produced and then used by separate teams. That is infeasible in one-person projects. There is no law that says clean-room design is the only way you can do non-derivative reuse of ideas, it is simply the method that is easiest to prove.

For practical purposes, it's extremely unlikely anyone would take you to court over some simple, publicly shared piece of code, especially without sending a cease-and-desist note up front.

I would be fine publishing it with a note similar to research paper citations:

Based on ideas from <project XYZ, Copyright 2020 XYZ, https://..../>

If you want to explain the reasoning further:

This software is based on ideas from <....>
Only non-copyrightable algorithms and ideas have been used and
this work is not derivative of project X.
  • 8
    I accept that I skipped over the question of whether papaya's work is a derivative of the original. But the starting position on translations is that they are, and it very much becomes papaya's job to translate the code in such a way that (s)he has a defence. As you point out, clean-room is one such way, but the OP hasn't done that, and it's too late for him/her to do it now. It seems to me your advice boils down to "infringe copyright and hope they won't sue"; given the NC-ND licence, it's not a bet I'd make.
    – MadHatter
    Commented Apr 3 at 7:16
  • 3
    @MadHatter Translations of e.g. books to other languages clearly are derivative, because the whole point is to convey the creative aspects. Translations of programs to other programming languages vary a lot, but I agree it is a big if. I do not suggest to infringe copyright, just that if papaya determines that to their reasonable interpretation their work is not derivative, worrying about how to prove it in court is not practically very important. A very strict interpretation would make e.g. most research papers unusable, as they commonly include pseudocode algorithms with no license.
    – jpa
    Commented Apr 3 at 7:40
  • 5
    I don't think that papaya can safely be advised to make this determination him/herself; to my mind, the one reasonably safe course of action along that path has already been closed. And I completely take your point about research papers, but they're normally published in an academic atmosphere where reuse is expected; this is under a specifically no-derivatives licence. But it's your answer; we'll let the community take a view.
    – MadHatter
    Commented Apr 3 at 8:02
  • 4
    I don't see why it should be. Computer code clearly contains copyrightable expression, and so should be no less protected against translation than the human-language equivalent. But if you think you have authorities that support your position, do by all means post them.
    – MadHatter
    Commented Apr 3 at 11:51
  • 4
    Indead, my translation is a derivative from the orinal code. I feel like my whole question is now a non-sense since I clearly kept the same structure and not only copied the open source mathematical ideas. No one will take me to court but I dont want to breach the copyright since I often need inputs from the authors of the original code to progress in my work. I beleive the best way to share my code is to get my work approuved and published by them.
    – papaya
    Commented Apr 3 at 14:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.