Skip to content

PyShield converts your Python source code (.py) into compiled binary files (.pyd) using Cython, making it extremely difficult to reverse-engineer. It then packages everything into a standalone Windows executable (.exe) that runs without requiring Python installation on the target machine.

License

Notifications You must be signed in to change notification settings

samay825/PyShield

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

🛡️ PyShield

The Ultimate Python Code Protection & Compilation Suite

PyShield Logo

PyShield converts your Python source code (.py) into compiled binary files (.pyd) using Cython,
making it extremely difficult to reverse-engineer. It then packages everything into a standalone
Windows executable (.exe) that runs without requiring Python installation on the target machine.

Transform your Python scripts into secure, compiled Windows executables with military-grade protection

FeaturesInstallationQuick StartScreenshotsContributing

Python 3.10+ Windows MIT License PyQt6

Stars Forks Watchers Last Commit

Repo Size Issues PRs Downloads

Download


PyShield Main Window


⚠️ Disclaimer

PyShield is designed for legitimate software protection purposes only.

This tool is intended to help developers:

  • Protect intellectual property and proprietary algorithms
  • Distribute commercial Python applications securely
  • Prevent casual reverse engineering of source code

DO NOT use this tool to hide malicious code, malware, or any software intended to harm users.

The developer assumes no responsibility for misuse of this software. By using PyShield, you agree to use it ethically and in compliance with all applicable laws.


🎯 What is PyShield?

PyShield is a powerful, all-in-one solution for protecting and distributing Python applications. It combines Cython compilation (converting .py to binary .pyd files) with PyInstaller packaging to create secure, standalone Windows executables.

🔥 Why PyShield?

❌ Problem ✅ PyShield Solution
Python source code is easily readable Compiles to binary .pyd files - unreadable!
Distributing apps requires Python installed Creates standalone .exe - no Python needed!
Complex PyInstaller configuration One-click automated build with smart detection
Selenium/Playwright apps fail after packaging Auto-bundles browser drivers & browsers
Manual dependency management Intelligent import scanning & bundling

✨ Features

🔒 Code Protection

  • Cython Compilation - Convert .py to native .pyd binaries
  • Source Code Removal - No readable Python in final build
  • Anti-Decompilation - Compiled C extensions are extremely hard to reverse
  • Obfuscation - Additional code protection layer

📦 EXE Generation

  • One-Click Build - Automated PyInstaller integration
  • UAC Admin Support - Request elevated privileges
  • Custom Icons - Brand your executables
  • Version Info - Embed metadata in EXE

🔍 Smart Detection

  • Auto Import Scanning - Detects all dependencies automatically
  • 80+ Framework Support - PyQt, Tkinter, Selenium, Playwright, AI/ML
  • Browser Bundling - Auto-bundle WebDrivers & Playwright browsers
  • Data File Detection - Include images, configs, assets

🎨 Modern Interface

  • Beautiful Dark Theme - Professional, easy on the eyes
  • Real-time Build Logs - Track every step of the process
  • Drag & Drop Support - Simple project selection
  • Splash Screen - Polished user experience

🌐 Supported Frameworks

PyShield automatically detects and properly bundles these frameworks:

PyQt5 PyQt6 Tkinter PySide6

Selenium Playwright Requests NumPy

Pandas OpenCV TensorFlow PyTorch


📋 System Requirements

Requirement Details Download Link
Operating System Windows 10/11 (64-bit) -
Python Version 3.10 or higher Download Python
Visual Studio Build Tools 2019 or newer with C++ Download Build Tools

🚀 Installation

📌 Step 1: Install Python 3.10+

📥 Click to expand Python installation guide
  1. Download Python from the official website:

    Download Python

  2. Run the installer with these settings:

    ┌─────────────────────────────────────────────────────────────┐
    │                    Python 3.14.2 Setup                      │
    │                                                             │
    │  ☑️ Install launcher for all users (recommended)           
    │  ☑️ Add python.exe to PATH  ⬅️ IMPORTANT! CHECK THIS!      
    │                                                             │
    │              [ Install Now ]    [ Customize ]               │
    └─────────────────────────────────────────────────────────────┘
    

    ⚠️ CRITICAL: You MUST check "Add python.exe to PATH" or PyShield won't work!

  3. Verify installation - Open Command Prompt (Win + R, type cmd):

    python --version

    ✅ Expected output: Python 3.14.2.x (or your installed version)

    pip --version

    ✅ Expected output: pip 24.x.x from ...


📌 Step 2: Install Visual Studio Build Tools

🔧 Click to expand Build Tools installation guide

Visual Studio Build Tools provides the C++ compiler required for Cython to convert Python to native binaries.

  1. Download Build Tools:

    Download Build Tools

  2. Run the installer and select the following:

    ┌─────────────────────────────────────────────────────────────┐
    │           Visual Studio Installer - Workloads               │
    │                                                             │
    │  ☑️ Desktop development with C++     ⬅️ SELECT THIS!       │
    │     └── MSVC v143 - VS 2022 C++ x64/x86 build tools         │
    │     └── Windows 11 SDK (10.0.22621.0)                       │
    │     └── C++ CMake tools for Windows                         │
    │                                                             │
    │  📦 Installation size: ~6.5 GB                              
    │                                                             │
    │                    [ Install ]                              │
    └─────────────────────────────────────────────────────────────┘
    
  3. Wait for installation - This may take 10-30 minutes depending on your internet speed

  4. Restart your computer after installation completes

  5. Verify installation - Open Developer Command Prompt for VS 2022 in your windows 10/11:

    cl

    ✅ If you see "Microsoft (R) C/C++ Optimizing Compiler Version..." you're ready!

    ❌ If you see "'cl' is not recognized", try opening "Developer Command Prompt for VS" from Start Menu


📌 Step 3: Download PyShield

Download

📦 Download Option 📝 Description 🔗 Link
🚀 EXE (Recommended) Ready-to-run Windows executable
No Python installation required!
EXE
📁 Source Code Full source code (for developers)
Requires Python & Build Tools
ZIP

👨‍💻 Option A: How to use this ?

📌 Step 4: Launch PyShield

run .exe 

🎉 PyShield is now ready to use!


⚡ Quick Start

Using the GUI

┌─────────────────────────────────────────────────────────────────┐
│  🛡️ PyShield v5.0                                    ─ □ ✕     │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  📁 Project Path                                                
│  ┌─────────────────────────────────────────────────┐ [Browse]   │
│  │ C:\Users\You\MyPythonProject                    │            │
│  └─────────────────────────────────────────────────┘            │
│                                                                 │
│  ⚙️ Build Options                                               
│  ┌─────────────────────────────────────────────────────────┐    │
│  │ ☑️ Enable Cython Compilation (.py → .pyd)                
│  │ ☑️ Create Standalone EXE                                  
│  │ ☐ Request UAC Admin Privileges                              
│  │ ☐ Show Console Window                                        
│  └─────────────────────────────────────────────────────────┘    │
│                                                                 │
│  🎨 Icon: [shield.ico]                        [Change Icon]     
│                                                                 │
│              ┌──────────────────────┐                           │
│              │    🚀 BUILD NOW      │                           
│              └──────────────────────┘                           │
│                                                                 │
│  📋 Build Log                                                   
│  ┌─────────────────────────────────────────────────────────┐    │
│  │ [16:30:01] ✓ Scanning project imports...                │    
│  │ [16:30:02] ✓ Detected 15 Python files                   │    
│  │ [16:30:03] ✓ Compiling main.py → main.pyd               │    │
│  │ [16:30:05] ✓ Compiling utils.py → utils.pyd             │    │
│  │ [16:30:08] ✓ Creating executable...                     │    │
│  │ [16:30:45] 🎉 BUILD SUCCESSFUL!                         │    │
│  └─────────────────────────────────────────────────────────┘     
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Build Steps

  1. Select Project → Choose your Python project folder
  2. Configure Options → Enable/disable features as needed
  3. Click Build → Watch the real-time build progress
  4. Get Your EXE → Find it in the dist/ folder

🛠️ Configuration Options

Option Description Default
Cython Compilation Convert .py files to .pyd binaries ✅ Enabled
Create EXE Generate standalone executable ✅ Enabled
UAC Admin Request admin privileges on launch ❌ Disabled
Console Window Show/hide console window ❌ Hidden
Custom Icon Use custom .ico file for EXE shield.ico
One-File Mode Bundle everything into single EXE ❌ Disabled

🔧 Troubleshooting

❌ "Python not found" or "'python' is not recognized"

Cause: Python is not in your system PATH.

Solution:

  1. Uninstall Python completely
  2. Download Python again from python.org
  3. During installation, ✅ CHECK "Add python.exe to PATH"
  4. Restart your computer
  5. Open new Command Prompt and verify: python --version
❌ "Unable to find vcvarsall.bat" or Cython compilation fails

Cause: Visual Studio Build Tools not installed or missing C++ components.

Solution:

  1. Download VS Build Tools
  2. Run installer and select "Desktop development with C++"
  3. Make sure these components are checked:
    • MSVC v143 - VS 2022 C++ x64/x86 build tools
    • Windows 11 SDK
  4. Restart your computer after installation
❌ Build completes but EXE crashes on startup

Cause: Missing dependencies or imports not detected.

Solution:

  1. Check build logs for any warnings
  2. Ensure all data files (images, configs) are in project folder
  3. Test running from source first: python main.py
  4. Check if antivirus is blocking the EXE
❌ Selenium/Playwright "driver not found" in EXE

Cause: Browser drivers not bundled with the EXE.

Solution: PyShield automatically bundles drivers, but ensure:

  1. Drivers are installed via pip install webdriver-manager (Selenium)
  2. Browsers are installed via playwright install (Playwright)
  3. Rebuild the project

🤝 Contributing

Contributions are what make the open-source community amazing! Any contributions you make are greatly appreciated.

How to Contribute

  1. 🍴 Fork the repository
  2. 🌿 Create your feature branch
    git checkout -b feature/AmazingFeature
  3. 💻 Commit your changes
    git commit -m "Add some AmazingFeature"
  4. 📤 Push to the branch
    git push origin feature/AmazingFeature
  5. 🔃 Open a Pull Request

Development Setup

# Clone your fork
git clone https://github.com/samay825/PyShield.git
cd PyShield

# Create dev environment
python -m venv .venv
.\.venv\Scripts\Activate.ps1

# Install dev dependencies
pip install -r requirements.txt
pip install pytest black flake8

# Run tests
pytest tests/

# Format code
black src/

📜 License

This project is licensed under the MIT License - see the LICENSE file for details.

MIT License

Copyright (c) 2026 Samay825

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files...

💖 Support the Project

If PyShield helped you protect your Python code, consider supporting the project:

Star Bug Feature


🙏 Acknowledgments

Special thanks to these amazing projects that make PyShield possible:

  • Cython - C-Extensions for Python
  • PyInstaller - Freeze Python applications
  • PyQt6 - Python Qt bindings
  • Python - The best programming language

Made with Love Python Coffee

Made with ❤️ by Samay825

⭐ Star this repo if you found it helpful!

About

PyShield converts your Python source code (.py) into compiled binary files (.pyd) using Cython, making it extremely difficult to reverse-engineer. It then packages everything into a standalone Windows executable (.exe) that runs without requiring Python installation on the target machine.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published