aosp
Python wrapper around an AOSP (Android Open Source Project) source tree. Sources build/envsetup.sh, runs lunch, exposes the resulting build environment as a Python object, and provides convenience accessors for the product-out tree.
Requires sh and yautil (uses docker_sh for sandboxed builds).
Install
pip install -e .
Python ≥ 3.9.
API
from aosp import Aosp, load_aosp, get_env
Aosp
Main object representing one AOSP checkout + build target.
aosp = Aosp(path="/path/to/aosp", build_target="aosp_arm64-eng")
# or
aosp = Aosp.from_path("/path/to/aosp", build_target="aosp_arm64-eng")
Notable properties:
| Member | Description |
|---|---|
path |
Absolute path to the AOSP root. |
build_target |
The lunch target. |
env |
dict of env vars exported by envsetup.sh + lunch. |
build_var |
dict of build variables from get_build_var. |
out |
AospProductOut — wrapper around $ANDROID_PRODUCT_OUT. |
external_paths |
Extra PATH entries injected when running commands inside the tree. |
AospProductOut
Returned by Aosp.out. Helpers for locating files under $ANDROID_PRODUCT_OUT:
| Member | Returns |
|---|---|
dir |
Absolute path of the product-out directory. |
system_dir |
system/ partition root. |
system_lib_dirs |
All directories on the target's LD_LIBRARY_PATH. |
system_bin_dirs |
All directories on the target's PATH. |
rc_path |
Path to the target's init *.rc. |
find_system_lib(basename) |
List of matching library files across system_lib_dirs. |
find_system_bin(basename) |
List of matching binaries across system_bin_dirs. |
load_aosp(...)
Module-level factory (see aosp.aosp.load_aosp) that constructs an Aosp from a config profile.
get_env(path, target=None) -> dict
Lower-level helper: sources build/envsetup.sh in path (and optionally runs lunch <target>), then returns the resulting environment as a dict.
env = get_env("/path/to/aosp", "aosp_arm64-eng")
print(env["ANDROID_PRODUCT_OUT"])
Metadata
Release files for aosp 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aosp-0.1.2.tar.gz | 7.5 kB | Without provenance | Details for aosp-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aosp-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for aosp-0.1.2-py3-none-any.whl |
Total release size: 13.9 kB
Release files / aosp-0.1.2.tar.gz
| Download URL | aosp-0.1.2.tar.gz |
|---|---|
| Size | 7.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
37fdb56926fedf0ef971ba6c745aa5dec25fa8a6382e6489e713395f30134b12
|
|
BLAKE2b-256 checksum How to use checksums |
b3780fae867f47eccfb7bb0731e70e643f9e647301cc43a71c2624778fffdb08
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Release files / aosp-0.1.2-py3-none-any.whl
| Download URL | aosp-0.1.2-py3-none-any.whl |
|---|---|
| Size | 6.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
10aa93b9819b157ce2902303a8f66f1e8bdf36a5ce523b1303cf8799df938b7b
|
|
BLAKE2b-256 checksum How to use checksums |
d5c41e30689ef7cf79f42b4f089093fdbe65b114a706768eb2580b954d85d290
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Security for aosp 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.