#python #resources #packaging #applications #packed #interpreter

python-packed-resources

Manage data structures containing Python resources

11 breaking releases

0.12.0 Dec 29, 2022
0.11.0 Nov 8, 2022
0.10.0 Jun 5, 2022
0.8.0 Oct 25, 2021
0.1.0 Apr 10, 2020

#594 in Data structures

Download history 3617/week @ 2024-07-20 3570/week @ 2024-07-27 3230/week @ 2024-08-03 3225/week @ 2024-08-10 3464/week @ 2024-08-17 4410/week @ 2024-08-24 3968/week @ 2024-08-31 3500/week @ 2024-09-07 3029/week @ 2024-09-14 3986/week @ 2024-09-21 3159/week @ 2024-09-28 2953/week @ 2024-10-05 3435/week @ 2024-10-12 4044/week @ 2024-10-19 3105/week @ 2024-10-26 2800/week @ 2024-11-02

13,853 downloads per month
Used in 5 crates (4 directly)

MIT/Apache

130KB
3K SLoC

About

This crate defines and implements a data format for storing resources useful to the execution of a Python interpreter. We call this data format Python packed resources. See the crate's documentation for more.

This crate is developed primarily for PyOxidizer. But it can be used outside the PyOxidizer project.

Getting Started

This crate defines a Rust library. There's nothing special about the library and it can be operated on like a typical Rust crate:

$ cargo build
$ cargo test
$ cargo doc

lib.rs:

Python Packed Resources

This crate defines and implements a data format for storing resources useful to the execution of a Python interpreter. We call this data format Python packed resources.

The idea is that a producer collects Python resources required by a Python interpreter - Python module source and bytecode, non-module resource files, extension modules, shared libraries, etc - attaches metadata to those resources (e.g. whether a Python module is also a package), and then serializes all of this out to a binary data structure.

Later, this data structure is parsed back into composite parts. e.g. to a mapping of Python module names and their respective data. This data structure is then consulted by a Python interpreter to e.g. power the module import mechanism.

This crate is developed primarily for PyOxidizer. But it can be used outside the PyOxidizer project. See the aforementioned docs for the canonical specification of this format.

Dependencies

~250KB