pyarmor.cli 9.1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. pyarmor.cli-9.1.2/PKG-INFO +74 -0
  2. pyarmor.cli-9.1.2/README.rst +53 -0
  3. pyarmor.cli-9.1.2/pyarmor/cli/__init__.py +46 -0
  4. pyarmor.cli-9.1.2/pyarmor/cli/__main__.py +801 -0
  5. pyarmor.cli-9.1.2/pyarmor/cli/bootstrap.py +207 -0
  6. pyarmor.cli-9.1.2/pyarmor/cli/bug.py +137 -0
  7. pyarmor.cli-9.1.2/pyarmor/cli/command.py +517 -0
  8. pyarmor.cli-9.1.2/pyarmor/cli/config.py +306 -0
  9. pyarmor.cli-9.1.2/pyarmor/cli/context.py +784 -0
  10. pyarmor.cli-9.1.2/pyarmor/cli/core.data.1 +0 -0
  11. pyarmor.cli-9.1.2/pyarmor/cli/core.data.2 +0 -0
  12. pyarmor.cli-9.1.2/pyarmor/cli/core.data.3 +0 -0
  13. pyarmor.cli-9.1.2/pyarmor/cli/default.cfg +530 -0
  14. pyarmor.cli-9.1.2/pyarmor/cli/docker.py +192 -0
  15. pyarmor.cli-9.1.2/pyarmor/cli/generate.py +191 -0
  16. pyarmor.cli-9.1.2/pyarmor/cli/hdinfo.py +81 -0
  17. pyarmor.cli-9.1.2/pyarmor/cli/merge.py +232 -0
  18. pyarmor.cli-9.1.2/pyarmor/cli/mixer.py +109 -0
  19. pyarmor.cli-9.1.2/pyarmor/cli/model.py +451 -0
  20. pyarmor.cli-9.1.2/pyarmor/cli/plugin.py +292 -0
  21. pyarmor.cli-9.1.2/pyarmor/cli/project.py +1179 -0
  22. pyarmor.cli-9.1.2/pyarmor/cli/public_capsule.zip +0 -0
  23. pyarmor.cli-9.1.2/pyarmor/cli/register.py +852 -0
  24. pyarmor.cli-9.1.2/pyarmor/cli/repack.py +793 -0
  25. pyarmor.cli-9.1.2/pyarmor/cli/resource.py +253 -0
  26. pyarmor.cli-9.1.2/pyarmor/cli/shell.py +478 -0
  27. pyarmor.cli-9.1.2/pyarmor.cli.egg-info/PKG-INFO +74 -0
  28. pyarmor.cli-9.1.2/pyarmor.cli.egg-info/SOURCES.txt +32 -0
  29. pyarmor.cli-9.1.2/pyarmor.cli.egg-info/dependency_links.txt +1 -0
  30. pyarmor.cli-9.1.2/pyarmor.cli.egg-info/entry_points.txt +4 -0
  31. pyarmor.cli-9.1.2/pyarmor.cli.egg-info/requires.txt +1 -0
  32. pyarmor.cli-9.1.2/pyarmor.cli.egg-info/top_level.txt +1 -0
  33. pyarmor.cli-9.1.2/setup.cfg +4 -0
  34. pyarmor.cli-9.1.2/setup.py +64 -0
@@ -0,0 +1,74 @@
1
+ Metadata-Version: 1.1
2
+ Name: pyarmor.cli
3
+ Version: 9.1.2
4
+ Summary: A comand line tool to obfuscate python scripts
5
+ Home-page: https://github.com/dashingsoft/pyarmor
6
+ Author: Jondy Zhao
7
+ Author-email: pyarmor@163.com
8
+ License: Free To Use But Restricted
9
+ Description: Protect Python Scripts By Pyarmor
10
+ =================================
11
+
12
+ Pyarmor is a command line tool used to obfuscate python scripts, bind obfuscated scripts to fixed machine or expire obfuscated scripts.
13
+
14
+ Key Features
15
+ ------------
16
+
17
+ * The obfuscated scritpt is still a normal `.py` script, in most of cases the original python scripts can be replaced with obfuscated scripts seamlessly.
18
+ * Provide many ways to obfuscate the scripts to balance security and performance
19
+ * Rename functions/methods/classes/variables/arguments, irreversible obfuscation
20
+ * Convert part of Python functions to C function, compile to binary by high optimize option, irreversible obfuscation
21
+ * Bind obfuscated scripts to fixed machine or expire obfuscted scripts
22
+ * Protect obfuscated scripts by Themida (Only for Windows)
23
+
24
+ Support Platforms
25
+ -----------------
26
+
27
+ * Python 3.7~3.13
28
+ * Windows
29
+ * Many linuxs, include embedded systems
30
+ * Apple Intel and Apple Silicon
31
+
32
+ Quick Start
33
+ -----------
34
+
35
+ Install::
36
+
37
+ pip install pyarmor
38
+
39
+ Obfuscate the script `foo.py`::
40
+
41
+ pyarmor gen foo.py
42
+
43
+ This command generates an obfuscated script `dist/foo.py` like this:
44
+
45
+ .. code:: python
46
+
47
+ from pyarmor_runtime import __pyarmor__
48
+ __pyarmor__(__name__, __file__, b'\x28\x83\x20\x58....')
49
+
50
+ Run it::
51
+
52
+ python dist/foo.py
53
+
54
+ More Resources
55
+ --------------
56
+
57
+ - `Home <https://github.com/dashingsoft/pyarmor>`_
58
+ - `Website <http://pyarmor.dashingsoft.com>`_
59
+ - `中文网站 <http://pyarmor.dashingsoft.com/index-zh.html>`_
60
+ - `Issues <https://github.com/dashingsoft/pyarmor/issues>`_
61
+ - `Documentation <https://pyarmor.readthedocs.io/>`_
62
+
63
+ Keywords: protect obfuscate encrypt obfuscation distribute
64
+ Platform: UNKNOWN
65
+ Classifier: Programming Language :: Python :: 3
66
+ Classifier: License :: Free To Use But Restricted
67
+ Classifier: Operating System :: MacOS
68
+ Classifier: Operating System :: Microsoft :: Windows
69
+ Classifier: Operating System :: POSIX
70
+ Classifier: Intended Audience :: Developers
71
+ Classifier: Topic :: Software Development :: Build Tools
72
+ Classifier: Topic :: Utilities
73
+ Classifier: Topic :: Security
74
+ Classifier: Topic :: System :: Software Distribution
@@ -0,0 +1,53 @@
1
+ Protect Python Scripts By Pyarmor
2
+ =================================
3
+
4
+ Pyarmor is a command line tool used to obfuscate python scripts, bind obfuscated scripts to fixed machine or expire obfuscated scripts.
5
+
6
+ Key Features
7
+ ------------
8
+
9
+ * The obfuscated scritpt is still a normal `.py` script, in most of cases the original python scripts can be replaced with obfuscated scripts seamlessly.
10
+ * Provide many ways to obfuscate the scripts to balance security and performance
11
+ * Rename functions/methods/classes/variables/arguments, irreversible obfuscation
12
+ * Convert part of Python functions to C function, compile to binary by high optimize option, irreversible obfuscation
13
+ * Bind obfuscated scripts to fixed machine or expire obfuscted scripts
14
+ * Protect obfuscated scripts by Themida (Only for Windows)
15
+
16
+ Support Platforms
17
+ -----------------
18
+
19
+ * Python 3.7~3.13
20
+ * Windows
21
+ * Many linuxs, include embedded systems
22
+ * Apple Intel and Apple Silicon
23
+
24
+ Quick Start
25
+ -----------
26
+
27
+ Install::
28
+
29
+ pip install pyarmor
30
+
31
+ Obfuscate the script `foo.py`::
32
+
33
+ pyarmor gen foo.py
34
+
35
+ This command generates an obfuscated script `dist/foo.py` like this:
36
+
37
+ .. code:: python
38
+
39
+ from pyarmor_runtime import __pyarmor__
40
+ __pyarmor__(__name__, __file__, b'\x28\x83\x20\x58....')
41
+
42
+ Run it::
43
+
44
+ python dist/foo.py
45
+
46
+ More Resources
47
+ --------------
48
+
49
+ - `Home <https://github.com/dashingsoft/pyarmor>`_
50
+ - `Website <http://pyarmor.dashingsoft.com>`_
51
+ - `中文网站 <http://pyarmor.dashingsoft.com/index-zh.html>`_
52
+ - `Issues <https://github.com/dashingsoft/pyarmor/issues>`_
53
+ - `Documentation <https://pyarmor.readthedocs.io/>`_
@@ -0,0 +1,46 @@
1
+ import logging
2
+
3
+ __VERSION__ = '9.1.2'
4
+
5
+ logger = logging.getLogger('cli')
6
+
7
+
8
+ class CliError(Exception):
9
+ pass
10
+
11
+
12
+ def resoptions(meth):
13
+
14
+ def process(self, res, *args, **kwargs):
15
+ self._options = self.ctx.get_res_options(res.fullname, self._Catalog)
16
+ return meth(self, res, *args, **kwargs)
17
+
18
+ return process
19
+
20
+
21
+ class Component(object):
22
+
23
+ def __init__(self, ctx):
24
+ self.ctx = ctx
25
+ self._options = {}
26
+
27
+ self.logger = logging.getLogger(self.LOGNAME)
28
+
29
+ def __getattr__(self, opt):
30
+ if opt.startswith('o_'):
31
+ return self._options.get(opt[2:], '')
32
+ elif opt.startswith('oi_'):
33
+ return int(self._options.get(opt[3:]))
34
+ elif opt.startswith('ob_'):
35
+ v = self._options.get(opt[3:], '')
36
+ if isinstance(v, str):
37
+ if v.isdigit():
38
+ return bool(int(v))
39
+ return v.lower() in ('1', 'true', 'on', 'yes')
40
+
41
+ return v
42
+ return AttributeError(opt)
43
+
44
+ def trace(self, res, node, value):
45
+ lineno = getattr(node, 'lineno', -1)
46
+ self.logger.info('%s:%s:%s', res.fullname, lineno, value)