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.

[!IMPORTANT] You need Python 3.14 or newer when installing from PyPI. The Homebrew formula installs its Python dependency for you.

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

[!NOTE] fanfox is the default provider. MangaDex-specific filters are available in YAML mode.

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-

[!TIP] Quote titles containing spaces. Run mangapy title --help for the complete command reference.

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"}'

[!CAUTION] Treat proxy credentials as secrets. Avoid putting authenticated proxy URLs in shell history, shared YAML files, screenshots, or logs.

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.

[!NOTE] MangaDex output names include the immutable chapter UUID. This prevents corrected metadata, translations, and scanlations from overwriting one another. Legacy number-only outputs are kept but are not reused because they do not identify a translation.

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mangapy-4.1.0.tar.gz (52.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mangapy-4.1.0-py3-none-any.whl (35.0 kB view details)

Uploaded Python 3

File details

Details for the file mangapy-4.1.0.tar.gz.

File metadata

  • Download URL: mangapy-4.1.0.tar.gz
  • Upload date:
  • Size: 52.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","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}

File hashes

Hashes for mangapy-4.1.0.tar.gz
Algorithm Hash digest
SHA256 18c30056ba1ab994a45d511e8e31c274fa02c8f98973b4817dbb3692b03dc9fb
MD5 991cf8323b0ba6b87ec91c8c599c6cad
BLAKE2b-256 065641f989fc03d985158dda2b734c9dbda7fa4e0f9d722bada8278187d0a662

See more details on using hashes here.

File details

Details for the file mangapy-4.1.0-py3-none-any.whl.

File metadata

  • Download URL: mangapy-4.1.0-py3-none-any.whl
  • Upload date:
  • Size: 35.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","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}

File hashes

Hashes for mangapy-4.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e8852d61216ac6f310c39509436ec064048454b8ee11674ead46a8b026bc4fc9
MD5 b58324b5081936c829d2e72607e91d32
BLAKE2b-256 5e8baf7bd9ca7698a3accc6e87848d955eca6d3028ab0ab4cddc2febc6778ed9

See more details on using hashes here.

Release history Release notifications | RSS feed

4.1.1

2 files

This release

4.1.0 This release

2 files

4.0.1

2 files

4.0.0

2 files

3.0.2

2 files

3.0.1

2 files

3.0.0

2 files

2.1.0

2 files

2.0.5

2 files

2.0.4

2 files

2.0.2

2 files

2.0.1

2 files

2.0.0

2 files

1.5.6

2 files

1.5.5

2 files

1.5.4

2 files

1.5.3

2 files

1.5.2

2 files

1.5.1

2 files

1.5.0

2 files

1.4.0

2 files

1.3.4

2 files

1.3.3

2 files

1.3.2

2 files

1.3.1

2 files

1.2.0

2 files

1.1.1

2 files

1.1.0

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page