ccbuild
ccbuild将python开发的项目、流程或脚本文件进行编译成C的动态共享库*.so文件,不影响项目运行,可用于某些场景下python源码保护。
依赖
- Linux
- Python >=2.7.10, <=3.10
- cython
安装
git repo with the development version
pip install git+https://github.com/yodeng/ccbuild.git
Pypi
pip install ccbuild
使用
$ ccbuild -h
相关参数解释如下:
| 参数 | 描述 |
|---|---|
| -h/--help | 打印帮助并退出 |
| -p/--python | 编译后运行项目使用的python解释器路径,非绝对路径会从$PATH中查找 |
| -i/--input | 需要编译的py文件或项目目录 |
| -o/--output | 编译后的项目或文件输出路径 |
| -t/--threads | cpu核数,默认5 |
| -c/--compile-continue | 若某个文件编译失败,是否跳过,继续编译,默认编译失败退出程序 |
| --exclude-dir | 跳过的编译目录,默认"__pycache__"会被跳过, 多个输入空白隔开,支持简单shell匹配 |
| --exclude-file | 跳过的编译文件,默认"__init__.py"会被跳过,多个输入空白隔开,支持简单shell匹配 |
| -v/--version | 打印版本并退出 |
-p/--python指定的解释器为编译后运行项目的解释器,相同版本的解释器可以通用
说明
-
编译后的输出目录,使用方式不变,只是项目中的
py文件变成了so二进制文件。 -
有可能存在编译失败的情况,原因是由于
python代码中有cython识别不了的未导入的模块,cython和python并不是百分百兼容,需要调整python代码即可通过编译。
Metadata
Release files for ccbuild 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ccbuild-1.1.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for ccbuild-1.1.0-py2.py3-none-any.whl |
| ccbuild-1.1.0-2-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for ccbuild-1.1.0-2-py2.py3-none-any.whl |
Total release size: 16.2 kB
Release files / ccbuild-1.1.0-py2.py3-none-any.whl
| Download URL | ccbuild-1.1.0-py2.py3-none-any.whl |
|---|---|
| Size | 8.0 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
6ab0c22806506e56b8932a10dcc4de15e8112285c2484d87635a7273a4d7a6c1
|
|
BLAKE2b-256 checksum How to use checksums |
66a91c80366a8cbc81bd24af02c1a62f63fac596b1d389ecefd12b4c0c1d495c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.5.0.1 requests/2.25.1 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/2.7.18
|
Release files / ccbuild-1.1.0-2-py2.py3-none-any.whl
| Download URL | ccbuild-1.1.0-2-py2.py3-none-any.whl |
|---|---|
| Size | 8.2 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
79c588fad93faada41d8c8033118dd636f0322767104ea880de5b788a4b30908
|
|
BLAKE2b-256 checksum How to use checksums |
e5139e837edbc9862a68ac234959eb9e6f2a8adc33675700210720506739636b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.5.0.1 requests/2.25.1 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/2.7.18
|
Security for ccbuild 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.