Skip to main content

Obfuscator

Utility to obfuscate Python code

Installation

pip install localstack-obfuscator

Usage

You need to have a config file in the project you want to obfuscate.

An example config file is given below:

custom_patches: false # if true, will use custom patches for dataclasses. Default is false.

# custom parameters for python_minifier
minify:
  remove_literal_statements: true

# list of files to exclude from obfuscation
exclude:
  - "constants.py"
  - "routes.py"

# list of files to remove from resulting build
remove:
  - ".venv"
  - "build"

target_dir: "outages" # relative to the build directory. The default is the same as current dir name
build_dir: "build" # relative to the current dir. The default is "build".
modify_in_place: false # Modify the code in the source directory directly. Overrides the target_dir/build_dir options. The default is False.

Note that the exclude and remove lists perform different functions:

  • The exclusion works on a per-file basis and is for files that should be kept in the package but not obfuscated.
  • The removal is for files and directories that should not be in the final build at all. This is, e.g., useful for the virtual environment directory or the build directory itself. It also improves the performance because the files are not even copied to the build directory in the first place.

To perform the obfuscation, run the obfuscator against the project directory.

localstack-obfuscator .

Metadata

Release files for localstack-obfuscator 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for localstack-obfuscator 1.1.0
File Size Uploaded Provenance Actions
localstack_obfuscator-1.1.0.tar.gz 3.9 kB Without provenance Details for localstack_obfuscator-1.1.0.tar.gz

Release files / localstack_obfuscator-1.1.0.tar.gz

Download URL localstack_obfuscator-1.1.0.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c56d345c9729856ee328eb9a5da73235ee9c22fecae053eedd4fec0a6c27b005
BLAKE2b-256 checksum
How to use checksums
1095b790ad2ccafbc6228d844e52f2f976d72390fbd8cd8a70bc641cbc682c9f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Security for localstack-obfuscator 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page