Metadata-Version: 2.4
Name: humble-books-dl
Version: 0.1.0
Summary: Download Books Bundle purchases from Humble Bundle via the command line.
Project-URL: Homepage, https://github.com/mitschenberger/humble-books-dl
Project-URL: Issues, https://github.com/mitschenberger/humble-books-dl/issues
License: MIT License
        
        Copyright (c) 2026 Michael Reich
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Requires-Python: >=3.10
Requires-Dist: requests>=2.28
Requires-Dist: tqdm>=4.64
Description-Content-Type: text/markdown

# humble-books-dl

A command-line tool for downloading Books Bundle purchases from Humble Bundle.

## Installation

```bash
pip install humble-books-dl
```

## Usage

Find your order KEY in the Humble Bundle purchase confirmation email or in the URL when viewing a bundle on humblebundle.com.

**List all items in a bundle:**

```bash
humble-books-dl list <order_key>
```

**Download a bundle:**

```bash
humble-books-dl download <order_key>
```

**Download a single item by number:**

```bash
humble-books-dl download <order_key> --item 3
```

By default, files are saved to `~/HumbleBundle/<bundle name>/` and formats are tried in the order `epub -> pdf -> mobi`. Files that already exist on disk are skipped.

**All download options:**

| Flag            | Description                                                                     |
|-----------------|---------------------------------------------------------------------------------|
| `--item N`      | Download only item N (as shown by the `list` command)                           |
| `--formats`     | Preferred formats in priority order. Falls back to all available if none match. |
| `--output`      | Download directory (default: `~/HumbleBundle`)                                  |
| `--no-progress` | Disable progress bars                                                           |

## Python API

```python
from humble_books_dl import HBPurchase

purchase = HBPurchase.from_order_key("ORDERKEY")
purchase.list_products()

purchase.download_all("~/HumbleBundle", formats=["epub", "pdf"])
purchase.download_product(3, "~/HumbleBundle", formats=["epub", "pdf"])
```

## License

MIT
