Metadata-Version: 2.4
Name: ddrescue-report
Version: 0.1.0
Summary: Parse a GNU ddrescue mapfile and summarise recovery progress (rescued %, bad-sector areas, largest bad region).
Project-URL: Homepage, https://www.save-my-disk.com
Project-URL: Documentation, https://www.save-my-disk.com
Author: Eric Gerard
License: MIT
License-File: LICENSE
Keywords: data-recovery,ddrescue,disk,forensics,mapfile,recovery
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: System :: Filesystems
Classifier: Topic :: System :: Recovery Tools
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# ddrescue-report

A tiny, dependency-free tool to parse a **GNU ddrescue** mapfile and print a
clear recovery summary: how much was rescued, how much is still non-tried, and
where the bad-sector areas are.

[GNU ddrescue](https://www.gnu.org/software/ddrescue/) is the standard tool for
imaging failing drives. It records its progress in a *mapfile*, but the raw file
is hard to read at a glance. `ddrescue-report` turns it into numbers you can act
on.

## Install

```
pip install ddrescue-report
```

## Usage

```
ddrescue-report rescue.map
```

Example output:

```
Total size    : 500.11 GiB
Rescued       : 499.98 GiB  (99.9740%)
Non-tried     : 0 B
Pending(*//-) : 132.00 MiB
Bad sectors   : 132.00 MiB  (0.0258%) in 7 area(s)
Largest bad   : 64.00 MiB at offset 0x1d2a40000
```

Read from stdin with `-`:

```
cat rescue.map | ddrescue-report -
```

## As a library

```python
from ddrescue_report import parse_mapfile, summarise

blocks = parse_mapfile(open("rescue.map").read())
s = summarise(blocks)
print(s.rescued_pct, s.bad_areas)
```

## Mapfile status characters

| Char | Meaning |
|------|---------|
| `+`  | finished (rescued) |
| `?`  | non-tried |
| `*`  | non-trimmed (failed) |
| `/`  | non-scraped (failed) |
| `-`  | bad-sector (failed) |

## More on data recovery

Guides on data recovery, ddrescue workflows and choosing recovery software:
**[save-my-disk.com](https://www.save-my-disk.com)**.

## License

MIT
