Skip to content

PyEmbedBuilder is a user-friendly GUI tool helping in creation of launchable, portable and ready-to-distribute open-source Python (.py) applications on Windows. No unsigned .exe and no cryptography - everything remains transparent and accessible through the source code to all end users.

License

Notifications You must be signed in to change notification settings

Vinventive/PyEmbedBuilder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 

Repository files navigation

PyEmbedBuilder

Version Platform License

PyEmbedBuilder is a user-friendly GUI for creating portable, open-source Python applications that you can share with other Windows users who don’t feel confident setting up a full Python environment themselves. It uses a .bat file to launch your (.py) Python app in a clear and secure way. It lunches as easily as any regular (.exe) executable software, but without the need to compile binary executables or pay hundreds of dollars to have your apps signed. It fully exposes the launcher and application source code to all end users, making it better suited for open for security audits open-source distribution rather than fully closed-source software. I’m simply sharing it with anyone interested, as I originally built this tool for my own use.

image

It automates the complex process of downloading embedded Python distributions, verifying their integrity, bootstrapping pip, installing dependencies, and securely extracting official components (like Tcl/Tk for Tkinter support) into a clean, portable folder structure.


πŸ”’ Security & Integrity

Security is the core design principle of PyEmbedBuilder:

  • Strict Verification: All downloads from python.org are verified.
  • HTTPS Only: Enforced TLS for network operations.
  • Audit Trail: Generates a comprehensive security_audit.log for every build, recording source URLs.
  • Path Sanitization: Automatically strips absolute paths from pip metadata (.dist-info) to prevent and minimize local system information leakage when distributing portable apps with embedded environments.
  • Zip-Slip Protection: Validates all archive extractions against directory traversal attacks.

✨ Key Features

  • Wizard-Style Interface: Modern, accessible Tkinter GUI with Dark/Light Mode, High Contrast Accessibility Mode and text scaling support.
  • Full Python Support:
    • Download any stable Python version (β‰₯ 3.12.10).
    • Optional Component Extraction: Automatically add Scripts, tcl, Lib, libs, and include foldersβ€”enabling full standard library support (including tkinter) in a portable embedded environment.
  • Dependency Management: Import your requirements.txt to pre-install packages into the portable environment.
  • Portable Output:
    • Generates .bat launchers automatically.
    • Configures ._pth files correctly for full isolation.
    • Creates fully independent and portable Python environments in a ..\My Projects\ folder by default.
  • Smart Caching: Optional downloads cache to save bandwidth when creating multiple similar projects (by default builder auto-clears cache upon each successful build).

πŸš€ Getting Started

1. Download & Verify

Download the release archive and its signature:

  • PyEmbedBuilder_(version).7z
  • PyEmbedBuilder_(version).7z.sha256

Verify the integrity (PowerShell):

Get-FileHash .\PyEmbedBuilder_(version).7z -Algorithm SHA256
# Compare output with the content of PyEmbedBuilder_(version).7z.sha256

2. Installation

PyEmbedBuilder is fully portable. No installation is required. It has been successfully built with a running instance of itself. The standalone portable version has been compressed with free 7-Zip software. To avoid any issues with .7z archives, I advise installing the free official 7-Zip software for Windows, available here.

  1. Extract PyEmbedBuilder.7z to a location of your choice (e.g., C:\PyEmbedBuilder).
  2. Navigate to the extracted folder.

3. Usage

Double-click launch_pyembed_builder.bat to start the application.

  1. Create Project:
    • Name your project.
    • Select a Python version (Recommended or Custom).
    • (Optional) Select a requirements.txt file.
    • (Recommended) Check "Add full stdlib..." to include Tkinter, pip, and standard headers.
  2. Review: Check the build plan and security parameters.
  3. Build: Watch the automated process:
    • Download & Verification
    • Core Extraction
    • Optional Components Extraction
    • pip Bootstrap
    • Optional Packages Installation (requirements.txt)
    • Paths Sanitization
  4. Complete: By default your portable environment is ready in ..\My Projects\<Project-Name>.

πŸ“¦ Output Structure

The builder creates self-contained environments structured for distribution:

My Projects/
└── Project-Name/
    β”œβ”€β”€ launch.bat                 # Your App Launcher
    β”œβ”€β”€ (your_app_here).py         # Entry Point to Your Python Application
    β”œβ”€β”€ install_dependencies.bat   # Add new libraries/packages
    β”œβ”€β”€ list_dependencies.bat      # List all currently installed libraries/packages
    β”œβ”€β”€ uninstall_dependencies.bat # Remove any libraries/packages
    β”œβ”€β”€ requirements.txt           # List of recomended required libraries in the current Python project (provide your own when building)
    β”œβ”€β”€ build_manifest.json        # App manifest for debuging (remove it before public distribution)
    β”œβ”€β”€ python-embed/              # The portable Python environment
    β”‚   β”œβ”€β”€ python.exe             # Python CLI Shell Binary
    β”‚   β”œβ”€β”€ pythonw.exe            # Python Window Mode Shell Binary
    β”‚   β”œβ”€β”€ Lib/                   # Standard library & site-packages
    β”‚   β”œβ”€β”€ Scripts/               # Pip and other CLI tools
    β”‚   └── ...
    └── ...

Disclaimer: This is a very early working alpha version of the software. Always test and verify your portable Python apps before sharing them with others.

About

PyEmbedBuilder is a user-friendly GUI tool helping in creation of launchable, portable and ready-to-distribute open-source Python (.py) applications on Windows. No unsigned .exe and no cryptography - everything remains transparent and accessible through the source code to all end users.

Resources

License

Stars

Watchers

Forks

Packages

No packages published