Skip to main content

se-imports: python source code encryption protection, it will decode in memrory and load module

Project description

se-imports: python source code encryption protection, it will decode in memrory and load module

se-imports

encode code

import shutil


def test_se_project(src_dir = '/home/project',dst_dir = '/home/project_se' , package_name='serving'):
    from se_imports import se_project_crypto
    #目标文件夹存在则自动删除
    autoremove_dst_exists = False
    #删除空目录
    autoremove_dst_empty_dir = True
    #忽略复制文件,文件对工程运行没有用
    ignore = shutil.ignore_patterns('test','.git','.idea','setup.py')

    #package_name
    # 如果是pypi包,package_name 需要设置包名,否则可以设置None

    #加密接受规则
    accept_rules = ['serving/utils/*', 'serving/run*', 'serving/http_client/http*']


    se_project_crypto(
        src_dir,
        dst_dir,
        is_use_root_name=False,
        autoremove_dst_exists=False,
        autoremove_dst_empty_dir=True,
        ignore = ignore,
        rules = accept_rules,
        key=bytes([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
        iv=bytes([1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15])
    )
    
test_se_project()

run code

import shutil

   
def run():

    import sys,os
    from se_imports import se_register_module

    root_dir = os.path.abspath(os.path.join(os.path.dirname(__file__),os.pardir))
    se_register_module(root_dir=root_dir)


    from serving.runner import main
    main()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

se_imports-0.1.1-py3-none-any.whl (7.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page