Pycompall is a wrapper around the default `compileall` Python utility to compile `.py` to `.pyc` files to provide a more configurable interface and as a build tool when configuring python files.
Project description
Pycompall Package
Pycompall is a wrapper around the default compileall
Python utility to compile .py
to .pyc
files to provide a more configurable interface and as a build tool when configuring python files.
This package is also useful for code obfuscation, especially since most .py
files can be substituted for their compiled bytecode equivalents most of the time.
Installation
pip install pycompall
Usage
pycompall compile [OPTIONS] [PATH]
.
Without any options, this will compile all .py
files in the current directory (or file) into the default __pycache__
directory.
Options
-r
, --recursive
Recurse through subdirectories.
--in-place
Remove original .py
files and replace them with compiled .pyc
files.
--create-empty-init
Create an empty __init__.py
file in the base directory path specified after compilation. Useful for interacting with other build tools such as colcon that require a package to have an __init__.py
file.
- Note: this only adds the file in the base directory specified, regardless of whether the
--recursive
flag is specified.
--exclude-files TEXT
Exclude pattern(s) for files to be excluded during compilation and replacement.
- Note: this option supports globbing patterns with python's
Path.match
method, but this requires globs to be passed as strings to the tool, so you must wrap the glob in quotes (e.g.pycompall compile --exclude-files '*.py'
). - To specify multiple files to exclude, write the flag again (e.g.
pycompall compile --exclude-files '*test.py' --exclude-files 'test/*.py'
)
--exclude-dirs TEXT
Exclude pattern(s) for directories to be excluded during compilation and replacement. Note that if the directory is skipped and --create-empty-init is True, the __init__.py
file will not be created.
- Note: this option supports globbing patterns with python's
Path.match
method, but this requires globs to be passed as strings to the tool, so you must wrap the glob in quotes (e.g.pycompall compile --exclude-dirs 'test*'
). - To specify multiple directories to exclude, write the flag again (e.g.
pycompall compile --exclude-dirs 'test' --exclude-dirs 'utils'
)
--ignore-symlinks
Sometimes symlinks causes problems. Enable this flag to ignore symlinks.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pycompall-0.2.0.tar.gz
.
File metadata
- Download URL: pycompall-0.2.0.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a5083e53f852efe7ce72b06723a83f54e563300a5e35b97c1bd35905e30f742 |
|
MD5 | 859d85421516f7613fcd320fc9637cd7 |
|
BLAKE2b-256 | a1178c512e752573d5131911b69e48528501b1ff05df89eb870960d142b716ac |
File details
Details for the file pycompall-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: pycompall-0.2.0-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3cde1fe86e8028ff592a87b7c5bc55f807e7a6d20222d78938cd2964b9ff799a |
|
MD5 | 4fe4eb0e8d529c40f9941d3aa1d59653 |
|
BLAKE2b-256 | 90d5cd1da3da362e41425e88aa0505dbc94f69163a9d65d7e6e0d3fb95b9973c |