Suppose I wrote my library in Python. How do I then wrap it in a plugin that others can install and use?

Closed due to the fact that the issue is too general for the participants jfs , insolor , Kromster , user194374, cheops 9 Aug '16 at 7:02 .

Please correct the question so that it describes the specific problem with sufficient detail to determine the appropriate answer. Do not ask a few questions at once. See “How to ask a good question?” For clarification. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • 3
    Maybe the package you mean? - Vladimir Gamalyan
  • from myFile import myClass - vadim vaduxa

1 answer 1

Training

1) It is necessary that the code is not executed when importing

2) Decide how you want to distribute. Options: file archive, python package with installation file, source code.

3) Write the documentation, it is possible to do it right in the code.

4) Bring code to PEP standards


Packaging

1) Archive option. Pack in zip, tar.gz. Share on stable hosting. That's all.

2) Source code. It is convenient to use specialized platforms such as github, bitbucket. Benefits. It is possible to receive a reverse response. Changes are visible.

3) Installation package. Minimum package structure . Spread on pypi python.

Naturally, all options can be combined if necessary.

  • one
    Taki can still be distributed as packages to distributions, deb-package any. - m9_psy
  • from exotics, it is possible to distribute copied (pyc, pyd, pyo) files, separate for different versions in order not to give out the source code. - Igor
  • @Igor nefuscirovanny pyc is easily translated to py. This is not the language to easily hide the code - FeroxTL
  • scripting languages ​​for this and are not intended, although complicating the lives of those who are not very well versed is quite possible. But this is another question about how to protect. - Igor