-1

I have develop python application, I want to deploy in client system so he cant see my code. How to do packaging (.whl) of project.

When client start the his system (windows 10 professional), my package should start and ready to use rest API to client

I am attaching my folder structure please help me enter image description here

Every Thing
  • 333
  • 2
  • 12
  • 3
    A wheel file not magically make your code invisible. – Klaus D. Sep 16 '19 at 06:55
  • @KlausD. you means code visible in wheel file? – Every Thing Sep 16 '19 at 07:16
  • It's quite easy to obtain the source code from python packages, even if they only contain the compiled object files (usually packages are just a zip of the source code!) See e.g. [uncompyle6](https://github.com/rocky/python-uncompyle6/). You're looking for obfuscation. – Thom Wiggers Sep 16 '19 at 08:29
  • 1
    Possible duplicate of [How do I protect Python code?](https://stackoverflow.com/questions/261638/how-do-i-protect-python-code) – Thom Wiggers Sep 16 '19 at 08:32

2 Answers2

0

follow the link for more details

If you want to create a package file you can use the following command.

python setup.py sdist
twine upload dist/*
shashank
  • 1,133
  • 2
  • 10
  • 24
0

A wheel is called a binary package because it is targetted to a specific architecture and can contain binary library. But those binary libraries are built from C source code, not from Python. For the rest, a whl file is just a zip file having a special structure, which means that it is enough to unzip it to directly read all the Python files, because it contains all what is required for the project, those pre-compiled binary objects and the Python source code (thanks to Thom Wiggers for noticing).

That being said, a .whl file is a useful package format that can be built with setuptools and its bdist_wheel extension. When both are installed you use:

python setup.py bdist_wheel

with an appropriate setup.py.

A full explaination would be far beyond what can be written in a SO answer, so if you want to go that way, I can only advise you to read the Python Packaging User Guide, specifically the Tool recommendations guide and the Packaging and distributing projects guide

Serge Ballesta
  • 143,923
  • 11
  • 122
  • 252
  • I want to emphasize that `.whl` files typically contain *both* the pre-compiled binary object files *and* the python source code. The OP appears to want to hide their source code... – Thom Wiggers Sep 16 '19 at 08:25
  • 1
    @ThomWiggers: Thanks for noticing. I have edited my post with your comment. Hope it is more clear now... – Serge Ballesta Sep 16 '19 at 08:36