PyOxidizer Documentation

repository·main·Indexed 27 days ago

https://github.com/indygreg/pyoxidizer

A tool for producing single-file executables that embed a Python interpreter and its dependencies to simplify application packaging and distribution. The project includes the pyembed Rust library for interpreter control, the oxidized_importer for loading resources from memory, and the Tugger suite of crates for platform-specific packaging (Apple, Windows, RPM, Snapcraft) and binary analysis.

Tokens
94.6K
Snippets
120
Records
646
Agent score
91%

What's inside PyOxidizer

  1. Overview of the oxidized_importer Python Extension

    main

    The oxidized_importer is a Python extension module used to manage Python resources and imports efficiently. It provides three primary capabilities:

    1. Custom Module Importing: Use the OxidizedFinder class to handle Python import statements and resource loading, which can include loading modules directly from memory.
    2. Resource Scanning: Scan the filesystem for Python resources (such as source modules, bytecode files, package resources, and distribution metadata) and convert them into Python objects.
    3. Resource Serialization: Serialize Python resource data into an efficient binary data structure. This allows you to create a standalone resources blob containing all necessary modules and bytecode to be distributed with a Python application.

    oxidized_importer is automatically included in applications built with PyOxidizer, but it can also be built as a standalone extension module for use with standard Python installations.

  2. Overview of the PyOxy Python Runner

    main
    PyOxy is a single-file Python distribution runner written in Rust. Unlike traditional distributions that rely on temporary files or virtual filesystems (like SquashFS), PyOxy imports everything directly from data embedded within the executable. It serves as an alternative to the standard python command, providing granular control over how a Python interpreter is executed. It is part of the PyOxidizer project and utilizes reusable components from PyOxidizer.
  3. Overview of Tugger

    main

    Tugger is an umbrella project consisting of several Rust crates that implement generic application packaging and distribution functionality. It defines Starlark primitives for scripting common packaging actions.

    Supported domains include:

    • Debian packaging formats
    • Software licensing
    • Snapcraft packaging
    • Apple code signing
    • Rust toolchain installation
    • Windows installer generation
  4. Overview of tugger-rpm

    main

    tugger-rpm is a Rust library crate designed to provide low-level functionality for RPM packaging. It is primarily used by the Tugger application distribution tool but is available as a standalone crate for other tools that require RPM packaging primitives.

    Key capabilities include:

    • Creating .rpm files from raw files.
  5. Overview of the pyembed Rust library

    main

    pyembed is a Rust library crate designed to facilitate the control of Python interpreters within Rust applications. It acts as a high-level wrapper around the pyo3 crate (which provides the standard Rust interface to Python's C APIs).

    Key advantages of using pyembed over pyo3 directly include:

    • Enhanced integration with the oxidized_importer extension module.
    • Support for importing Python modules and resources directly from memory.
  6. Overview of tugger-code-signing

    main
    tugger-code-signing is a Rust library crate that provides functionality for code signing. While it is a component of the Tugger application distribution tool (which is part of the PyOxidizer project), it is designed as a standalone crate to allow other tools to reuse its code signing capabilities.
  7. Overview of tugger-windows-codesign

    main
    tugger-windows-codesign is a Rust library crate designed to provide code signing functionality on Windows. It is a component of the Tugger application distribution tool within the PyOxidizer project, but it is exposed as a standalone crate to allow other tools to reuse its capabilities for Windows-specific code signing tasks.
  8. Overview of Oxidized Importer

    main

    oxidized-importer is a Rust crate designed to produce a Python extension module named oxidized_importer.

    Key capabilities include:

    • Python Meta Path Finder: Provides a mechanism to load Python resources from a pre-built index, including loading directly from memory.
    • Filesystem Scanning: Scans the filesystem to identify Python resources.
    • Resource Loading: Loads discovered resources into the custom meta path finder.
    • Data Serialization: Serializes indexed data into a binary data structure optimized for rapid loading of available Python resources.
  9. Overview of tugger-apple

    main
    tugger-apple is a Rust library crate designed for packaging functionality on Apple platforms. It is primarily used by the Tugger application distribution tool (part of the PyOxidizer project) but is available as a standalone crate for other tools that need to perform similar packaging tasks on macOS/Apple hardware.