1# Concepts
2
3This library has two main abstractions:
4
5- {any}`WheelSource`: Serves as source of information about a wheel
6  file.
7- {any}`WheelDestination`: Handles all file writing and
8  post-installation processing.
9
10## WheelSource
11
12These objects represent a wheel file, abstracting away how the actual
13file is stored or accessed.
14
15This allows the core install logic to be used with in-memory wheel
16files, or unzipped-on-disk wheel, or with {any}`zipfile.ZipFile`
17objects from an on-disk wheel, or something else entirely.
18
19This protocol/abstraction is designed to be implementable without a
20direct dependency on this library. This allows for other libraries in
21the Python Packaging ecosystem to provide implementations of the
22protocol, allowing for more code reuse opportunities.
23
24One of the benefits of this fully described interface is the possibility
25to decouple the implementation of additional validation on wheels
26(such as validating the RECORD entries in a wheel match the actual
27contents of the wheel, or enforcing signing requirements) based on what
28the specific usecase demands.
29
30## WheelDestination
31
32These objects are responsible for handling the writing-to-filesystem
33interactions, determining RECORD file entries and post-install actions
34(like generating .pyc files). While this is a lot of responsibility,
35this was explicitly provided to make it possible for custom
36`WheelDestination` implementations to be more powerful and flexible.
37
38Most of these tasks can either be delegated to utilities provided in
39this library (eg: script generation), or to the Python standard libary
40(eg: generating `.pyc` files).
41