Skip to main content

mangapy

Download manga chapters from the terminal as images or PDFs.

PyPI Python Build License: MIT

Getting started · CLI examples · YAML mode · Configuration · Development setup


mangapy is a command-line downloader for FanFox and MangaDex. Download one chapter, a range, the latest chapter, or an entire series—with one PDF per chapter when you want a portable archive.

Highlights

Feature What it gives you
📚 Flexible chapter selection Download one chapter, an inclusive range, the latest chapter, or everything available.
🖼️ Images or PDFs Keep the original page images or create a separate PDF for every selected chapter.
🧾 Batch configuration Describe downloads from multiple providers in one YAML file.
⚡ Provider-aware downloads MangaDex downloads chapters and pages concurrently while respecting its request rate.
♻️ Safe reruns Completed chapter images and PDFs are detected so repeat runs do not download them again.
🖥️ Terminal-friendly output Interactive terminals get styled progress; redirected output and CI logs stay plain.

Supported providers

Provider CLI name Language filtering Content ratings Data-saver images
FanFox fanfox — — —
MangaDex mangadex ✅ ✅ ✅

Getting started

Install with pipx

pipx installs mangapy in an isolated environment while making the command available globally:

pipx install mangapy

Install with Homebrew

On macOS:

brew install alemar11/tap/mangapy

Confirm the installation:

mangapy --version
mangapy --help

CLI examples

The shortest command downloads the latest available chapter from FanFox as images into ~/Downloads/mangapy:

mangapy title bleach

Choose chapters

Goal Command
Download chapter 1 mangapy title bleach --chapter 1
Download chapters 0 through 10 mangapy title bleach --chapter 0-10
Download every chapter mangapy title bleach --all
Use MangaDex mangapy title bleach --chapter 1 --source mangadex
Choose an output directory mangapy title bleach --chapter 1 --out ~/Downloads
Create one PDF per chapter mangapy title bleach --all --pdf
Redownload an existing chapter mangapy title bleach --chapter 1 --force

Chapter ranges are inclusive. Open-ended ranges are supported too:

# Chapter 85 and every available chapter after it
mangapy title "tower of god" --chapter 85-

Control retries and progress

Disable network retries for benchmarking or fail-fast workflows:

mangapy title bleach --chapter 1 --no-retry

Disable the progress display for scripts and compact logs:

mangapy title bleach --chapter 1 --no-progress

Force a fresh download of the selected chapters while preserving the current files until each replacement has downloaded successfully:

mangapy title bleach --chapter 1 --force

Set NO_COLOR to disable terminal colors while keeping progress output enabled:

NO_COLOR=1 mangapy title bleach --chapter 1

Use a proxy

Pass a JSON object with both http and https entries. Each URL must include its scheme; the proxy is used for provider requests and chapter images.

mangapy title "one piece" \
  --out ~/Downloads \
  --proxy '{"http":"http://proxy.example:8080","https":"http://proxy.example:8080"}'

YAML mode

YAML mode is useful for repeatable downloads across multiple titles and providers:

mangapy yaml path/to/downloads.yaml
---
debug: false
force: false
no_retry: false
no_progress: false
output: "~/Downloads/mangapy"

downloads:
  - source: fanfox
    title: bleach
    pdf: true
    download_single_chapter: "10"

  - source: fanfox
    title: naruto
    download_chapters: "10-13"

  - source: mangadex
    title: blue lock
    translated_language: [en]
    content_rating: [safe, suggestive, erotica]
    data_saver: false
    download_all_chapters: true

Global settings act as defaults. A download entry can override debug, force, no_retry, no_progress, output, and proxy for that title.

Chapter selectors

Use at most one selector per download entry:

YAML field Example Selects
download_single_chapter "10" One chapter
download_chapters "10-13" An inclusive range
download_chapters "85-" A chapter and everything after it
download_last_chapter true The latest downloadable chapter
download_all_chapters true Every available chapter
No selector — The latest downloadable chapter

MangaDex options

These fields are valid only when source: mangadex:

YAML field Default Description
translated_language [en] One language code or a list of language codes.
content_rating [safe, suggestive, erotica] One rating or a list of ratings accepted by MangaDex.
data_saver false Use MangaDex's smaller data-saver page images.
All YAML fields

Global fields

Field Type Purpose
downloads list Download entries to process.
output string Default output directory.
proxy mapping Default http and https proxy URLs.
debug boolean Enable debug logging.
force boolean Redownload and replace existing chapter files.
no_retry boolean Disable network retries.
no_progress boolean Disable progress output.

Per-download fields

Field Type Purpose
source string fanfox or mangadex; defaults to fanfox.
title string Manga title to find. Required.
output string Override the global output directory.
pdf boolean Create one PDF for each selected chapter.
proxy mapping Override the global proxy.
debug boolean Override global debug logging.
force boolean Override the global forced-download setting.
no_retry boolean Override the global retry setting.
no_progress boolean Override the global progress setting.
download_single_chapter string or number Select one chapter.
download_chapters string Select an inclusive or open-ended range.
download_last_chapter boolean Select the latest downloadable chapter.
download_all_chapters boolean Select every available chapter.
translated_language string or list MangaDex translation language filter.
content_rating string or list MangaDex content-rating filter.
data_saver boolean Use MangaDex data-saver images.

More ready-to-run configurations are available in samples/. To run one directly from a source checkout:

uv run python3 scripts/dev_run.py sample.yaml

Configuration

Output layout

Downloads are organized by provider and manga beneath the selected output directory. Image mode stores page files under an images directory; PDF mode creates one PDF per chapter.

Mangapy owns each completed chapter image directory. After a successful image download, stale regular files in that chapter directory are removed so the local pages match the provider response.

Exit codes

Code Meaning
0 Every requested download completed successfully.
1 An operational, configuration, search, or partial-download error occurred.
2 The command line or input was rejected by the argument parser.
130 The download was interrupted by the user.

Development setup

Install mise and clone the repository:

git clone https://github.com/alemar11/mangapy.git
cd mangapy
mise install
mise run setup

mise install provides the required Python 3.14 and uv. mise run setup creates the project-local .venv and installs the application and development dependencies.

Verify the checkout:

mise run lint
mise run test
uv run mangapy --help

The default test command excludes live provider tests because they contact third-party services and may be affected by site changes or rate limits.

When opening the repository in VS Code, accept the recommended Python, Python Environments, Python Debugger, and Ruff extensions. Select .venv as the Python interpreter if VS Code does not detect it automatically.

See Development for the complete editor workflow and Tests for live-provider and targeted test commands.

License

Distributed under the MIT License.

Metadata

Release files for mangapy 4.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mangapy 4.1.2
File Size Uploaded Provenance Actions
mangapy-4.1.2.tar.gz 52.8 kB Without provenance Details for mangapy-4.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mangapy 4.1.2
File Interpreter ABI Platform Actions
mangapy-4.1.2-py3-none-any.whl Python 3 none any Details for mangapy-4.1.2-py3-none-any.whl

Total release size: 87.7 kB

Release files / mangapy-4.1.2.tar.gz

Download URL mangapy-4.1.2.tar.gz
Size 52.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a11c2e014e678fc3726d27018e39269b44dcd1a54b270da5c0b5518671f53fc9
BLAKE2b-256 checksum
How to use checksums
bd05b2099c793506ee246afbf1e30bf84e2983ef000761757af5807205efac41
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / mangapy-4.1.2-py3-none-any.whl

Download URL mangapy-4.1.2-py3-none-any.whl
Size 35.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a62cf5b4b14733bbee2c303c044637fbfd9de7ee29f92781d6adcd8b2033bef5
BLAKE2b-256 checksum
How to use checksums
7870a0f40a330e46c9cf1530d851b6370ad0eac8f2023d3fc32fcddbd6ccdedc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for mangapy 4.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.

Release history Release notifications | RSS feed

This release

4.1.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page