Skip to main content

A demo PyPi package to demonstrate Python code distribution in a safe and automated way

Project description

SafePI

A PyPi package to demonstrate Python code distribution in a safe and automated way

Steps

  1. Make a package with file structure like this demo package
  2. The src folder contains source code of the normal Python package project
  3. The src/libs contains necessary .pyd(.so) files
  4. The libs_root.py must be included at the head of py files where some pyd module is called.
  5. The src_cython folder is the Cython files needed to protect and compile as pyd files.
  6. The build_pakcage.py in the root and build_cython_libs.py in the src_cython are automated scripts respectively.
  7. Please see examples folder to see how to test a function from the PyPI package where the code is compiled and protected.

Functions

You cannot find the source code of Person.py in this package, which prevents code theft.

from safepi.World import greet_times
# This function's algorithm is within a .pyd (.so in Linux) file compiled by Cython. 
# The source code cannot be found in the package and is therefore protected.
greet_times(n=5)

build_package.py: rapidly build Cython files, PyPI package and upload the package to PyPI website quickly. (your upload token is required!)

src_cython/build_cython_libs.py: Rapidly build Cython files and deploy all *.pyd files to to `src/libs' folder

License

The SafePI project is provided by Donghua Chen.

Project details


Download files

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

Source Distribution

SafePI-0.0.1a1.tar.gz (31.8 kB view details)

Uploaded Source

Built Distribution

SafePI-0.0.1a1-py3-none-any.whl (29.1 kB view details)

Uploaded Python 3

File details

Details for the file SafePI-0.0.1a1.tar.gz.

File metadata

  • Download URL: SafePI-0.0.1a1.tar.gz
  • Upload date:
  • Size: 31.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.21.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.6

File hashes

Hashes for SafePI-0.0.1a1.tar.gz
Algorithm Hash digest
SHA256 a83f2b34b4cf6a4cd8fad5a503169414b7f1652b29d0df42af764b6214296455
MD5 a1596b9b8671dd7251d6dfb0b548330c
BLAKE2b-256 2134c06e92eeed96485549624a7206bf64cb3333763ac1ee28c75fd901280e2b

See more details on using hashes here.

File details

Details for the file SafePI-0.0.1a1-py3-none-any.whl.

File metadata

  • Download URL: SafePI-0.0.1a1-py3-none-any.whl
  • Upload date:
  • Size: 29.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.21.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.6

File hashes

Hashes for SafePI-0.0.1a1-py3-none-any.whl
Algorithm Hash digest
SHA256 f90a1d28556d7c998eab3db518d41353b0b1fe7777f646e2d75074d8317d3d73
MD5 2be274361a96a252e96371fc53173f2a
BLAKE2b-256 6ce2123a3181d6aa6ab6f7261809cab9fb6d57ae3f5659635f1265ce18422f82

See more details on using hashes here.

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