Package: goldenmask
Goldenmask: Protect your python source code简体中文Goldenmask is a tool to protect your python source code easily. It has two methods at the moment: usingCompileallor usingCython. It has a corresponding option named--layer/-l, you can choose your favorite method by yourself. Meanwhile, it can protect different file types: python files end with.py, wheel packages end with.whland source package end with.tar.gz.Goldenmask is a name derived from a  Chinese kungfu named "JinZhongZhao". Because it is not a qualified phrase in a sense,  this name is so unique that can be used as a temporary compilation directory named__goldenmask__and a compilation information file named.goldenmaskwhich contains the detailed python version string (fromsys.version) and the platform string (fromplatform.unmae()) .Let's try to goldenmask now!Quick Start$pipinstallgoldenmask# 默认方法是使用 Compileall 编译为 pyc$goldenmaskyourpythonfile.py
Alldone!✨🍰✨

$tree-a.
.
├──__goldenmask__
│├──.goldenmask
│└──yourpythonfile.pyc
└──yourpythonfile.py1directory,3files# 用生成的 .so 文件替换原始的 py 文件$goldenmask-i-l2yourpythonfile.py
Alldone!✨🍰✨

$tree-a.
.
├──.goldenmask
└──yourpythonfile.so0directories,2filesInstallationGoldenmask is distributed onPyPIand supports Python 3.6+. You can simply install goldenmask as below:$pipinstall-UgoldenmaskHowever, it's a better choice to use a virtual environment:$python-mvenvenv# On Windows:$.\venv\Scripts\activate# On Linux:$sourceenv/bin/activate
$pipinstallgoldenmask--upgradeBecause goldenmask depends on Cython, you should make sure that there is an appropriate C compiler on your machine. You can see thedetailed guideon Cython's documentation. By the way, if you works on aLinuxsystem, you can easily fetch everything you need with one commandsudo apt-get install build-essentialon Ubuntu andyum groupinstall "Development Tools"on Centos. However, If you are usingMac OS XorWindows, you may spend quite some time installing this compilers.UsageYou can get everything using option--help:$ goldenmask --help
Usage: goldenmask [OPTIONS] [FILES_OR_DIRS]...

  Goldenmask is a tool to protect your python source code easily.

  FILES_OR_DIRS can be python files, wheel packages,source packages or dirs
  contain python files.

Options:
  -l, --layer <int>  Level of protection: 1 - compileall; 2 - cython.
  -i, --inplace      Whether compile python files in place.
  --no_smart         This will copy and compile everything you specified.
  --help             Show this message and exit.portect the wheel package：$goldenmaskgoldenmask-0.2.1-py3-none-any.whlAlldone!✨🍰✨
$tree-a.
.
├──__goldenmask__
│├──.goldenmask
│└──goldenmask-0.2.1-py3-none-any.whl
├──.goldenmask
└──goldenmask-0.2.1-py3-none-any.whl1directory,4filesprotect the source packege：$goldenmask-l2--inplacegoldenmask-0.1.2.tar.gzrunningbuild_ext
building'goldenmask.cli'extension
...
Alldone!✨🍰✨
$tree-a.
.
├──.goldenmask
└──goldenmask-0.1.2.tar.gzprotect the dir contians python files：$goldenmaskpip-download/
Alldone!✨🍰✨ContributeGoldenmask usesPoetryto develop, you can follow these steps to get involved：fork the project goldenmaskclone the forked projectinstallPoetryrunpoetry installto install dependencies，modify the code, run the tests and finally submit pull requestsCreditsTheblogfromProdesire.