- Python 45.6%
- C 25.2%
- Shell 15.7%
- JavaScript 5.6%
- CSS 4%
- Other 3.9%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .github | ||
| apps | ||
| docs | ||
| examples | ||
| host | ||
| include | ||
| patches | ||
| platform | ||
| src | ||
| tests | ||
| third_party | ||
| tools | ||
| web | ||
| .clang-format | ||
| .clang-tidy | ||
| .gitignore | ||
| CONTRIBUTING.md | ||
| CPYTHON_VERSION.txt | ||
| demo.gif | ||
| LICENSE | ||
| Makefile | ||
| README.md | ||
| roadmap.md | ||
| THIRD_PARTY_NOTICES.md | ||
PS5-Python
CPython for the PlayStation 5
A practical Python runtime, browser launcher, and app supervisor for PS5 homebrew.
Experimental but functional port of the CPython language runtime to the jailbroken PS5 payload environment.
This repository currently targets CPython 3.14.7, pinned to upstream source
commit 823f0323ee6ec1402088b73bce1a38473cac36dc. The exact pin is recorded in
CPYTHON_VERSION.txt; this is not an unpinned “latest
Python” port.
The project now ships a standalone interpreter, a browser-based Python manager, process-backed application jobs, and a tested standard-library subset. It is still intended for development and homebrew payload environments, not stock retail consoles.
Demo
What is included
- CPython 3.14.7, pinned to upstream commit
823f0323ee6ec1402088b73bce1a38473cac36dc. - Standalone and web-launcher ELF artifacts built with the PS5 Payload SDK.
- 170 of 189 pinned top-level standard-library entries present in the runtime bundle (about 90% module presence; not API-parity coverage).
- Browser interpreter, script editor, app arguments, and independently stoppable process-backed applications.
- Practical examples for Flask, SQLite, storage, networking, files, logs, Markdown, static sites, webhooks, and regular scripts.
The remaining limitations are explicit: ordinary subprocess execution,
process pools, IPv6, GUI/PTY stacks, in-console packaging/bootstrap, and some
native extension paths are outside the current PS5 payload contract.
Built-in examples
The release includes these manifest-backed examples. Web apps use the listed default port; the regular script app has no listening port.
| Example | Mode | Port | Purpose |
|---|---|---|---|
| Flask Dashboard | Web | 9101 | Runtime information, current time, and a JSON health endpoint |
| Storage Inspector | Web | 9102 | Read-only /data/python directory and file browser |
| SQLite Notes | Web | 9103 | Persistent notes stored in SQLite |
| Network Toolbox | Web | 9104 | DNS, TCP connectivity, and HTTP status checks |
| LAN File Browser | Web | 9105 | Read-only file browsing and downloads from / |
| Log Viewer | Web | 9106 | ShadowMountPlus log selection, tailing, and filtering |
| Markdown Documentation | Web | 9107 | Safe browser view of local Markdown files |
| Webhook Inspector | Web | 9108 | Captures and displays the last 25 HTTP requests |
| Static Site Starter | Web | 9109 | App-local HTML, CSS, JavaScript, and JSON endpoint |
| Media Catalog | Web | 9110 | Read-only /data media index grouped by type and size |
| System Report | Script | — | Prints runtime details and supplied command-line arguments |
The standalone interpreter also includes examples/main.py
as a minimal script-launch example. Each app has its own README with usage
details, paths, and configuration options.
Documentation
| Document | Purpose |
|---|---|
| Project status | Concise implementation, verification, and limitation matrix |
| Standard-library status | Coverage inventory, tested APIs, omissions, and upstream-derived checks |
| PS5 limitations | Platform, kernel, SDK, GUI, PTY, subprocess, and packaging boundaries |
| Web launcher guide | Browser manager, API, app lifecycle, arguments, and deployment |
| App bundles | Self-contained app manifests, dependencies, assets, and modes |
| Testing guide | Host checks, PS5 aggregate tests, lifetime tests, and recovery |
| Release guide | Tags, release assets, self-hosted PS5 builds, and local fallback |
| Contributing | Development workflow and pull-request checklist |
| Third-party notices | Upstream projects, build-time dependencies, and attribution |
The implementation roadmap is in roadmap.md. Test provenance and portable-subset rules are documented in tests/UPSTREAM_TESTS.md.
Status
The implementation snapshot is summarized in a table in
docs/status.md. In brief, the project builds CPython 3.14.7
for PS5, passes the 68-script aggregate suite, includes 170 of 189 pinned
stdlib entries, and provides a browser launcher with independently stoppable
process-backed applications. Module-level coverage is in
docs/stdlib-status.md; platform boundaries are in
docs/ps5-limitations.md.
Build the first PS5 ELF
Run these from WSL at the repository root:
make source-fetch
make host-build
make ps5-core
The PS5 build and test targets invoke lint automatically. Run the source
quality checks directly when iterating from WSL:
make format # apply the checked-in clang-format policy
make format-check # verify formatting without modifying files
make tidy # run clang-tidy with the PS5 compile definitions
make lint # run format-check and tidy
The project-owned C and header files under src/ are formatted using the
checked-in .clang-format policy. Clang-Tidy uses
.clang-tidy and analyzes those files with C11 and the same
PS5-facing include paths used by the launcher build. Vendored CPython sources
are intentionally excluded.
PS5 builds use all WSL CPU threads by default and automatically use ccache
when available. Select the compiler cache explicitly with PS5_CACHE=ccache
or PS5_CACHE=sccache; disable caching with PS5_CACHE=none (or the legacy
PS5_CCACHE=0). The cache applies to both CPython compilation and launcher
link commands.
The SDK uses LLVM lld by default. mold is supported as an opt-in
experiment:
PS5_LINKER=mold make ps5-core
Use PS5_JOBS=8 to override automatic parallelism. sccache must be
installed inside WSL and available on its PATH; the same applies to ccache
and mold.
The core artifacts are:
build/ps5/python.elf— the standalone PS5 interpreter launcher.build/ps5/libpython3.14.a— the static runtime library for a future custom launcher.build/ps5/cpython-lib/— the minimal external runtime bundle, including the Python-levelospath wrappers.
time is already compiled into the static interpreter as a built-in C module.
The initial standard-library slice adds os and its POSIX path/stat/ABC
dependencies from the matching CPython checkout. The hardware test is
tests/stdlib/os_time.py.
The launcher accepts the script path as its first argument and an optional
runtime directory as its second argument. If omitted, the runtime directory
defaults to /data/python/cpython-lib:
python.elf /data/python/main.py /data/python/cpython-lib
The reproducible hardware loop builds the ELF and runtime bundle, creates the required PS5 FTP directories, uploads them, and launches the ELF:
PS5_HOST="<your-PS5-IP>" make ps5-run
PS5_HOST="<your-PS5-IP>" make ps5-run SCRIPT=examples/main.py
PS5_HOST="<your-PS5-IP>" make ps5-run SCRIPT=tests/core_suite.py
The target is not a native app package yet; it is intentionally one ELF, one external Python script, and one small runtime directory.
Phase 4 lifetime checks are available with:
make host-lifetime
PS5_HOST="<your-PS5-IP>" make ps5-lifetime
Run the aggregate hardware tests, including the standard-library checks, with:
PS5_HOST="<your-PS5-IP>" make ps5-test
Run those tests plus the repeated-process lifetime checks with:
PS5_HOST="<your-PS5-IP>" make ps5-suite
The live TLS smoke test can also be run directly when external DNS and internet access are available:
PS5_HOST="<your-PS5-IP>" make ps5-run SCRIPT=tests/stdlib/test_tls_handshake.py
ps5-core and ps5-web only build artifacts; they do not run hardware tests.
ps5-test builds the ELF, uploads the test bundle, and runs all 68 aggregate
tests. ps5-suite adds the lifetime checks. RUN_TIMEOUT is set to 120
seconds for the aggregate run.
The deployment root defaults to /data/python. Override it when needed with
PS5_RUNTIME_ROOT=/some/other/absolute/path.
See docs/testing.md for the /data/python versus
/download0 storage decision and the intentional error tests.
See docs/stdlib-status.md for the exact standard- library coverage, omitted APIs, PS5 limitations, upstream sources, and tests. Update that document whenever a standard-library module changes.
See docs/ps5-limitations.md for the consolidated split between remaining implementation work and deep PS5 kernel/SDK limits.
The PS5 build automatically downloads and builds the pinned OpenSSL 3.5.2
static dependency under build/ps5/deps/openssl. To build it independently,
run bash tools/build_openssl_ps5.sh from WSL. The resulting _ssl and
_hashlib modules are linked into the interpreter.
Multiple applications can be packaged independently. See docs/app-bundles.md and the complete example in apps/flask_dashboard. Validate and deploy it with:
make host-app APP=apps/flask_dashboard
PS5_HOST="<your-PS5-IP>" make ps5-app APP=apps/flask_dashboard
The web deployment ships a practical starter suite under apps/: a Flask
runtime dashboard, storage and LAN file browsers, SQLite notes, network
checks, log and Markdown viewers, a webhook inspector, a static-site starter,
and a media catalog, plus a regular system_report script. Each web app
listens on its own documented port so they can run together under the process
supervisor, and every app card accepts optional command-line arguments.
Prepare an app's pure-Python dependencies on the host with
make package-app APP=apps/myapp; the PS5 receives the completed bundle and
does not run pip or download packages.
The browser-based manager is documented in docs/web-launcher.md. Start it with:
PS5_HOST="<your-PS5-IP>" make ps5-web
The Run script view submits bounded source bodies to the native
POST /api/script/run endpoint and shares persistent interpreter state with
WebREPL. Packaged applications run as independent process-backed jobs and can
be launched and stopped concurrently; file-backed scripts remain on the
web-launcher roadmap.
Manual release deployment
For a prebuilt install, download python-ps5-<version>.tar.gz from the
Releases page and
extract it on your computer. Copy these extracted directories to the PS5 using
your FTP client:
runtime/cpython-lib/ -> /data/python/runtime/cpython-lib/
web/ -> /data/python/web/
apps/ -> /data/python/apps/
The archive also contains these three ELFs under runtime/:
runtime/python.elf
runtime/python-web.elf
runtime/python-app-supervisor.elf
Run one Python script
Copy a .py file to /data/python/main.py, then launch the standalone ELF
from elfldr or your payload manager:
ELF: /data/python/runtime/python.elf
Args: /data/python/main.py /data/python/runtime/cpython-lib
Run the web launcher
Launch these ELFs in order from elfldr or your payload manager:
1. ELF: /data/python/runtime/python-app-supervisor.elf
Args: 8092
2. ELF: /data/python/runtime/python-web.elf
Args: 8090 8091 8092
Open http://<PS5-IP>:8090/ in a browser. The arguments are the HTTP port,
TCP WebREPL port, and local application-supervisor port. Keep the supervisor
running while using the web launcher.
Connect to the raw TCP WebREPL from WSL, Linux, or macOS with netcat:
nc <PS5-IP> 8091
For command history when rlwrap is installed:
rlwrap nc <PS5-IP> 8091
The prompt accepts one Python source line at a time. Use the second launcher argument if you choose a different WebREPL port.
The PS5 configure path uses the FreeBSD compatibility triplet expected by the
SDK (x86_64-pc-freebsd) and the tracked patch in
patches/ps5-freebsd-configure.patch. Optional modules that require a
separate math library are excluded from the core target.
CI and releases
The CI workflow runs the host suite and shell validation on every push and pull request. PS5 hardware tests remain an explicit operator step because the SDK and a jailbroken console are not available on GitHub-hosted runners.
The release workflow builds the standalone
and web ELF artifacts on a self-hosted runner labeled ps5-sdk, clones and
installs the PS5 Payload SDK into temporary runner storage, packages the
runtime bundle, and uploads the ELF files, archive, and checksums to an
existing GitHub Release. docs/releasing.md also provides
the local gh release upload fallback.
Credits
Built with the PS5 Payload SDK by John Törnblom (ps5-payload-dev). Third-party components, authors and licenses are listed in THIRD_PARTY_NOTICES.md.
License
Copyright © 2026 BlackBearReloaded. Licensed under GPL-3.0-or-later; see LICENSE. Third-party components keep their own licenses. Binary releases are built from the tagged source in this repository.
Disclaimer
- No affiliation. This is an independent homebrew project. It is not affiliated with, endorsed by, or sponsored by Sony Interactive Entertainment. "PlayStation", "PS5" and related marks are trademarks of Sony Interactive Entertainment Inc. Python is a registered trademark of the Python Software Foundation.
- No proprietary material. No Sony SDK, firmware, encryption keys or decrypted system modules are included.
- No warranty. This project is provided "as is", without warranty of any kind, to the extent permitted by law. See sections 15 and 16 of the GPL.
- Use at your own risk. Running homebrew requires a modified console, which may void its warranty, breach the platform's terms of service, or cause data loss.
- Legal use only. Use it only with hardware, accounts and content you own. This project does not support or enable piracy.
AI assistance
This project was developed with AI assistance from OpenAI and/or Anthropic tools.
