Development¶
This page is for contributors working on the repository locally.
Local Setup¶
Clone the repo and sync dependencies with uv:
uv sync
Install pre-commit hooks:
uv run pre-commit install
The repository also provides:
make install
Useful Commands¶
Run The CLI¶
uv run webtoon-downloader --help
Run The Main Checks¶
make check
That currently covers:
uv lock --check- pre-commit
mypydeptry
Run Tests¶
make test
or directly:
uv run pytest --cov --cov-config=pyproject.toml --cov-report=xml
Build Documentation¶
make docs-test
or serve locally:
make docs
Build Distributions¶
make build
Repository Layout¶
| Path | Purpose |
|---|---|
webtoon_downloader/cmd |
CLI entrypoints, user-facing exceptions, progress display |
webtoon_downloader/core |
downloader logic, fetchers, models, exceptions |
webtoon_downloader/storage |
output writers |
webtoon_downloader/transformers |
image transformation helpers |
tests/ |
test suite |
docs/ |
MkDocs documentation |
Code Style Notes¶
Project tooling currently includes:
ruffmypypytestpre-commit
When editing code:
- keep async boundaries explicit
- prefer focused exceptions over broad user-facing messages
- keep CLI parsing separate from core downloader logic
Where To Make Changes¶
CLI Behavior¶
Start in:
webtoon_downloader/cmd/cli.pywebtoon_downloader/cmd/exceptions.pywebtoon_downloader/cmd/progress.py
Webtoon Parsing Or Fetching¶
Start in:
webtoon_downloader/core/webtoon/fetchers.pywebtoon_downloader/core/webtoon/extractor.pywebtoon_downloader/core/webtoon/api.py
Download Pipeline¶
Start in:
webtoon_downloader/core/webtoon/downloaders/comic.pywebtoon_downloader/core/webtoon/downloaders/chapter.pywebtoon_downloader/core/downloaders/image.py
Output Formats¶
Start in:
webtoon_downloader/storage/file.pywebtoon_downloader/storage/zip.pywebtoon_downloader/storage/pdf.py
Common Contributor Tasks¶
Add A New CLI Flag¶
- Add the option in
cmd/cli.py - Thread it into
WebtoonDownloadOptions - Apply it in the appropriate core component
- Add tests
- Update the docs
Fix A Scraping Regression¶
- Reproduce with a failing URL
- Inspect the relevant HTML or API response
- Update the fetcher or extractor
- Add or update regression coverage
- Document any new limitation if the site behavior changed
Add A New Output Format¶
- Implement an
AioWriter - Wire it in from
comic.py - Update the CLI docs and README
- Add end-to-end tests where practical
Release And Packaging¶
The project uses uv_build as its build backend and defines the CLI script in pyproject.toml:
[project.scripts]
webtoon-downloader = "webtoon_downloader.cmd.cli:run"
For publishing, see the repository make targets:
make buildmake publishmake build-and-publish