========== Man Page ========== .. contents:: Contents :depth: 2 :local: :backlinks: top .. highlight:: console Pyarmor is a powerful tool to obfuscate Python scripts with rich option set that provides both high-level operations and full access to internals. pyarmor ======= .. program:: pyarmor .. describe:: Syntax pyarmor [options] ... .. describe:: Options -h, --help show available command set then quit -v, --version show version information then quit -q, --silent suppress all normal output :option:`... <-q>` -d, --debug show more information in the console :option:`... <-d>` --home PATH set Pyarmor HOME path :option:`... <--home>` These options can be used after :program:`pyarmor` but before command, here are available commands: ================================ ==================================== :ref:`gen ` Obfuscate scripts :ref:`gen key ` Generate outer runtime key :ref:`cfg ` Show and configure environments :ref:`reg ` Register Pyarmor ================================ ==================================== See :command:`pyarmor -h` for more information on a specific command. .. describe:: Description .. option:: -q, --silent Suppress all normal output. For example:: pyarmor -q gen foo.py .. option:: -d, --debug Show more information in the console When something is wrong, print more debug information in the console. For example:: pyarmor -d gen foo.py .. option:: --home PATH[,GLOBAL[,LOCAL[,REG]]] Set Pyarmor :term:`Home Path`, :term:`Global Path`, :term:`Local Path` and registration file path The default paths * :term:`Home Path` is :file:`~/.pyarmor/` * :term:`Global Path` is :file:`~/.pyarmor/config/` * :term:`Local Path` is :file:`./.pyarmor/` * registration file path is same as :term:`Home Path` All of them could be changed by this option. For example, change home path to :file:`~/.pyarmor2/`:: $ pyarmor --home ~/.pyarmor2 ... Then * :term:`Global Path` is :file:`~/.pyarmor2/config/` * Registration files are stored in the :file:`~/.pyarmor2/` * :term:`Local Path` still is :file:`./.pyarmor/` Another example, keep all others but only change global path to :file:`~/.pyarmor/config2/`:: $ pyarmor --home ,config2 ... Another, keep all others but only change local path to :file:`/var/myproject`:: $ pyarmor --home ,,/var/myproject/ ... Another, set registration file path to :file:`/opt/pyarmor/`:: $ pyarmor --home ,,,/opt/pyarmor ... It's useful when using :command:`sudo` to run :command:`pyarmor` occasionally. This makes sure the registration file could be found even switch to another user. When there are many Pyarmor Licenses registered in one machine, set each license to different path. For example:: $ pyarmor --home ~/.pyarmor1 reg pyarmor-regfile-2051.zip $ pyarmor --home ~/.pyarmor1 gen project1/foo.py $ pyarmor --home ~/.pyarmor2 reg pyarmor-regfile-2052.zip $ pyarmor --home ~/.pyarmor2 gen project2/foo.py Start pyarmor with clean configuration by setting :term:`Global Path` and :term:`Local Path` to any non-exists path ``x``:: $ pyarmor --home ,x,x, gen foo.py .. seealso:: :envvar:`PYARMOR_HOME` .. _pyarmor gen: pyarmor gen =========== Generate obfuscated scripts and all the required runtime files. .. program:: pyarmor gen .. describe:: Syntax pyarmor gen