Skip to main content

Use Cython to compile Python code to binary and support git-diff to get changed files conveniently.

Project description

Encrypt your Python project

Use Cython to compile Python code to binary and support git-diff to get changed files conveniently.

Installation

$ pip install encryptpy

Basic Usage

Usage: encryptpy [OPTIONS] COMMAND [ARGS]...

  Encrypt your Python code

Options:
  --config TEXT  The config file, ignore if given is invalid  [default:
                 .encryptpy.cfg]
  --help         Show this message and exit.

Commands:
  clean     Simply clean `build` and `__pycache__` directory in DIRS
  git-diff  Compile files between two COMMITS, see `git-diff`: `--name-only`
  init      Copy src to build-dir and do compile, usually used for the...
  run       Compile given Python code files

For the subcommand info, use encryptpy <subcommand> --help.

Examples

For example, there is a package named package_a (notice the work directory):

$ tree -a .

.
├── .encryptpy.cfg
└── package_a
    ├── __init__.py
    ├── main.py
    ├── README.md
    ├── setup.py
    └── utils.py

1 directory, 6 files

The .encryptpy.cfg's contents are as follow:

[encryptpy]
; Files will be compiled
paths =
    package_a
; Files will be ignored when compiling
ignores =
    setup.py
; For command `init`, files will be ignored when copying
copy_ignores =
    *.pyc
    *.md
; The build directory
build_dir = build
; For commands `run` and `git-diff`, whether the source .py will be removed
clean_py = 0

1. Use in the first time

$ encryptpy init .

Look the build directory:

$ tree -a build

build
├── .encryptpy.cfg
└── package_a
    ├── __init__.cpython-38-x86_64-linux-gnu.so
    ├── main.cpython-38-x86_64-linux-gnu.so
    ├── setup.py
    └── utils.cpython-38-x86_64-linux-gnu.so

1 directory, 5 files

2. Use normally by run

$ encryptpy run package_a/main.py

The package_a/main.py will be recompiled to main.cpython-38-x86_64-linux-gnu.so

3. Use normally by git-diff

$ encryptpy git-diff 0.1 0.2

The changed files between tag(or commit, or branch) 0.1 and 0.2 will be compiled.

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

encryptpy-1.0.0.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

encryptpy-1.0.0-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file encryptpy-1.0.0.tar.gz.

File metadata

  • Download URL: encryptpy-1.0.0.tar.gz
  • Upload date:
  • Size: 7.9 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.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for encryptpy-1.0.0.tar.gz
Algorithm Hash digest
SHA256 62218091d042e19c90546d5ebfd4f2b589e3150a8db83f116fc9d6aebe573f32
MD5 27d9fecde533c2c9ac554ed6ffbb09f2
BLAKE2b-256 9a52a2b8d74823c5547cc6ed0ef8f0b0ba346103318fb61adcf691c62c1c955f

See more details on using hashes here.

Provenance

File details

Details for the file encryptpy-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: encryptpy-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.5 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.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for encryptpy-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e92da0a06e617adb07869d16b8c21da720081e93b89e5f0b30684d099d45ddea
MD5 b2f42f8a7d2138e7dfdc8548e335c3dd
BLAKE2b-256 1a2ee1ac8ae91f7490f179bac5e06716a5487ec7c7dc46047c85a53f781dbc13

See more details on using hashes here.

Provenance

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