installer

Hide navigation sidebar
Hide table of contents sidebar
Back to top
Toggle table of contents sidebar

# Welcome to installer’s documentation

This is a low-level library for installing a Python package from a wheel distribution. It provides basic functionality and abstractions for handling wheels and installing packages from wheels.

- Logic for “unpacking” a wheel (i.e. installation).

- Abstractions for various parts of the unpacking process.

- Extensible simple implementations of the abstractions.

- Platform-independent Python script wrapper generation.

## Basic Usage

    import sys
    import sysconfig

    from installer import install
    from installer.destinations import SchemeDictionaryDestination
    from installer.sources import WheelFile

    # Handler for installation directories and writing into them.
    destination = SchemeDictionaryDestination(
        sysconfig.get_paths(),
        interpreter=sys.executable,
        script_kind="posix",
    )

    with WheelFile.open("sampleproject-1.3.1-py2.py3-none-any.whl") as source:
        install(
            source=source,
            destination=destination,
            # Additional metadata that is generated by the installation tool.
            additional_metadata={
                "INSTALLER": b"amazing-installer 0.1.0",
            },
        )