A TUI to recover overwritten or deleted data.
Project description
RecoverPy
Scan raw partitions and recover data by inspecting disk blocks directly.
🎬 Demo
🔎 Overview
When a file is deleted, its metadata disappears first. The underlying disk blocks often remain intact until they are reused.
RecoverPy scans raw partition data directly and searches for byte patterns across the entire device. If the blocks have not been overwritten, fragments of deleted files can still be located by their content.
It lets you inspect matching blocks, navigate adjacent ones, and extract what remains in a straightforward way.
If the blocks are gone, recovery is impossible. If they are still there, RecoverPy helps you retrieve them.
🧭 What you can do
- Search a partition or disk image for a specific string.
- Inspect the disk blocks where matches are found.
- Move across adjacent blocks to recover fragmented data.
- Select and save useful content.
RecoverPy does not attempt to interpret filesystem structures or restore filenames. It focuses on exposing what remains on disk and making it accessible.
📦 Installation
Requirements
- Linux
- Python 3.9+
Accessing raw block devices typically requires sudo.
Using uv
sudo uvx recoverpy
Or install locally:
uv tool install recoverpy
sudo recoverpy
Using pip
python -m pip install recoverpy
sudo recoverpy
▶️ Usage
Start RecoverPy:
sudo recoverpy
- Select a partition.
- Enter a distinctive search string.
- Start the scan.
- Open a result.
- Inspect and navigate blocks.
- Save useful content.
Using a unique identifier, configuration key, or sentence fragment generally produces better results than common words.
⚙️ How it works
RecoverPy operates directly on the raw byte stream of a block device.
The selected partition is opened in read-only mode and scanned sequentially using fixed-size chunks. The scanner processes the stream incrementally, keeping a small overlap between chunks to ensure that matches spanning chunk boundaries are not missed.
Pattern matching is performed at the byte level. For every match, RecoverPy records the exact absolute offset within the device. This offset becomes the reference point for block inspection and navigation.
Block reads are performed using explicit offsets rather than relying on filesystem abstractions. This allows precise access to adjacent blocks without loading large portions of the device into memory.
The entire scan is streaming-based and memory-bounded: RecoverPy never loads the full partition into memory.
⚠️ Limitations
RecoverPy works on raw data. It does not reconstruct files automatically or infer file boundaries.
Results may be partial or fragmented. If the underlying blocks have already been overwritten, recovery is not possible.
Accessing block devices typically requires sudo. To reduce the risk of further overwriting, avoid writing to the target partition during recovery and unmount it when possible.
🤝 Contributing
If you run into a bug or think something could be improved, feel free to open an issue. And if you’d like to work on it yourself, pull requests are always appreciated.
🛠 Development
Project structure:
recoverpy/ui/— Textual interfacerecoverpy/lib/search/— streaming search enginerecoverpy/lib/storage/— block and device accessrecoverpy/lib/text/— decoding utilitiestests/— unit and integration tests
Setup
uv sync --dev
Run locally
sudo uv run recoverpy
Run tests
uv run pytest -q
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file recoverpy-2.3.0.tar.gz.
File metadata
- Download URL: recoverpy-2.3.0.tar.gz
- Upload date:
- Size: 2.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86244abf9db5eee5c002d603a8f88e30b162ac377130738393c18ed0a3991cc5
|
|
| MD5 |
11eb91d7d1b1c87a3b1ed047b086bc98
|
|
| BLAKE2b-256 |
00d02b19cad9334b3f10d60d8f50fbcec9780b144605ebd337e542558a41341f
|
File details
Details for the file recoverpy-2.3.0-py3-none-any.whl.
File metadata
- Download URL: recoverpy-2.3.0-py3-none-any.whl
- Upload date:
- Size: 46.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c9165e9991dc0d6341713ad088aea056e480ebdbbf7de9932bfd53416250d831
|
|
| MD5 |
c011e15ec9bbe6fc7a441fdbddd5c977
|
|
| BLAKE2b-256 |
b1faa92eee3a54d9e348215ba25935134b9cdf57fbdaac029018a4a6c395ce4d
|