Python HTML Shell JavaScript Other
Clone or download
Latest commit 6696f2c Jul 15, 2018
Failed to load latest commit information.
docs Fix typo May 3, 2018
src Refine code Jul 15, 2018
tests Add testcase Apr 30, 2018
webapp Deprecate webapp Jan 29, 2018
.gitignore Ignore upload script Feb 8, 2018
ChangeLog.rst Add change log Jul 15, 2018 Refine data files Feb 8, 2018 Refine format May 3, 2018 Remove extra blanks Feb 16, 2018 Add testpkg files Apr 16, 2018


Pyarmor is a command line tool used to import or run obfuscated Python scripts.

It protects Python scripts by the following ways:

  • Obfuscate source file to protect constants and literal strings.
  • Obfuscate byte code of each code object.
  • Clear f_locals of frame as soon as code object completed execution.
  • Expired obfuscated scripts, or bind to fixed machine.

Refer to Protect Python Scripts By Pyarmor

Support Platforms

  • Python 2.5, 2.6, 2.7 and Python3
  • Prebuilt Platform: win32, win_amd64, linux_i386, linux_x86_64, macosx_intel
  • Embeded Platform: Raspberry Pi, Banana Pi, TS-4600 / TS-7600

Quick Start


The simple way is pip

    pip install pyarmor

Or get source package from pypi/pyarmor

Pyarmor is a command line tool, main script is After you get source package, unpack it to any path, then run as common python script


If Pyarmor is installed by pip, there is a command will be avaiable in Python script path


Basic Usage

The following examples show how to obfuscate a python package pybench, which locates in the examples/pybench in the source of pyarmor.

Obfuscate package pybench directly:

    python obfuscate --src examples/pybench --entry \
                                "*.py" "package/*.py"

    # Note that quotation mark is required for file patterns, otherwise
    # it will be expanded base on current path by shell.
    # This command will create an extra file in the
    # --src path, and save all the obfuscated scripts to default output
    # path "dist" in the current path
    cd dist

    # Check obfuscated script

    # Run obfuscated script

Use project to manage obfuscated scripts:

    mkdir projects
    python init --src examples/pybench --entry \

    # This command will create 2 files: .pyarmor_config,
    # in the project path "projects/pybench"
    cd projects/pybench

    # And there is a shell script "pyarmor" is created at the same time.
    # (In windows, the name is "pyarmor.bat")
    # Now run command "build" to obfuscated all the scripts
    ./pyarmor build

    # Check obfuscated script
    cd dist

    # Run obfuscated script

There is a webui used to manage project easily. Start it

    # For windows

    # For linux

    # If Pyarmor is installed by pip

Here is online demo Pyarmor Demo

More usage, refer to User Guide and Mechanism


Pyarmor is published as shareware. Free trial version never expires, the limitation is

  • Project Capsule generated by trial version is NOT random, but FIXED by hardcode.

A registration code is required to generate random project capsule.

  • Personal user: one registration code is enough.
  • Company user: one registration code is only used for one project/product.


Click Purchase,

A registration code will be sent to your immediately after payment is completed successfully.

After you receive the email which includes registration code, copy registration code only (no newline), then replace the content of "license.lic" with it.

Check License

    python --version

The registration code is valid forever, it can be used permanently.

Change Log

Report issuses

Any question feel free email to