How d1gitale/ranoparse works
Purpose and execution
Ranoparse is a Python CLI pipeline that downloads a ranobe from ranobehub.org and produces EPUB volumes in a user-selected output directory. The operational entry points are:
• init.py — initializes/persists the download destination.
• app.py — accepts a novel’s main-page URL and starts processing.
• bridge.py — an application-level integration boundary, likely connecting orchestration with parsing/output behavior.
Runtime and dependency boundary
The project runs on Python, with the selected version indicated by .python-version. Dependency installation and command execution use uv:
• pyproject.toml
• uv.lock
• .python-version
The principal external service is ranobehub.org; its HTML/pages are the upstream content source. EPUB is the promised output format, while the filesystem is the downstream storage boundary.
CLI initialization stage
init.py separates environment setup from parsing: users first provide a destination directory, then run the parser against a URL. This makes output-location state/configuration a prerequisite for the main workflow rather than an argument repeated on every run.
• init.py
• app.py
Application orchestration
app.py is the main control-plane entry point. It should own argument handling, loading the configured destination, invoking the parser, and coordinating output creation. It is the appropriate boundary for user-visible progress/errors and for translating a source URL into a complete multi-volume job.
• app.py
• bridge.py
• src/__init__.py
Source acquisition and parsing
The parsing subsystem is centered in src/parse.py. Based on the repository purpose, this layer is responsible for interpreting a ranobehub novel page and traversing the content needed to obtain volumes/chapters. It should isolate site-specific document assumptions from CLI orchestration and EPUB generation.
• src/parse.py
• src/helpers.py
Transformation and EPUB output
The primary data flow is: main-page URL → parsed novel metadata/content hierarchy → per-volume chapter content → EPUB artifacts written beneath the configured destination. bridge.py is the likely handoff point between parsed domain data and the output/EPUB-facing implementation, keeping source parsing distinct from publication assembly.
• bridge.py
• src/parse.py
• app.py
Supporting shared logic
src/helpers.py is the shared utility layer for parsing and/or output operations. It should remain below the parser and orchestration layers, rather than becoming another entry point. The src package provides the internal module boundary for application logic.
• src/helpers.py
• src/__init__.py
Main entry points: app.py Process novel URL · parse.py Site parser · bridge.py Publication bridge · init.py Initialize destination
Components 13
CLI workflow
- User
- Python + uv · Python version and dependency execution boundary.
pyproject.toml - Initialize destination
init.py - Saved destination · Persisted output-directory selection.
- Process novel URL · Coordinates a complete multi-volume job.
app.py
Application core
- src package
src/__init__.py - Site parser · Traverses novel, volume, and chapter pages.
src/parse.py - Shared helpers
src/helpers.py - Novel content hierarchy · Parsed metadata, volumes, and chapters.
- Publication bridge · Hands parsed content to EPUB-facing output behavior.
bridge.py
Other components
- ranobehub.org · Novel pages and chapter content source.
- EPUB volumes · One or more generated volume files.
- Selected output directory
Connections 18
- User → Initialize destination: selects destination
- Initialize destination → Saved destination: persists
- User → Process novel URL: provides novel URL
- Python + uv → Initialize destination: runs
- Python + uv → Process novel URL: runs
- Process novel URL → Saved destination: loads
- Process novel URL → Site parser: starts parsing
- Site parser → ranobehub.org: fetches pages
- Site parser → Shared helpers: uses
- Site parser → Novel content hierarchy: produces
- Process novel URL → Publication bridge: coordinates output
- Novel content hierarchy → Publication bridge: hands off content
- Publication bridge → Shared helpers: uses
- Publication bridge → EPUB volumes: assembles
- EPUB volumes → Selected output directory: writes beneath
- Saved destination → Selected output directory: identifies
- src package → Site parser: contains
- src package → Shared helpers: contains