WNTranslate
Simple yet comprehensive AI-assisted webnovel translation tool. Keeps track of the plot properly to ensure smooth translation.
Models and testing
Tested with local llama.cpp self-hosted Qwen3.6 35B A3B model, Deepseek V4.1 Flash, and Claude Haiku 5.5. I recommend using this library with a provider that supports json_schema (which Deepseek does not support) although Deepseek worked decently well with our no json schema mode.
A high parameter model is recommended to understand the prompt and properly apply translations. This library uses a four-pass system (analyze, translate, review, apply glossary) every single translation, and thinking mode is recommended to be OFF (ReasoningEffort.NONE) or LOW (ReasoningEffort.LOW), otherwise each chapter will take a lot of time.
Testing chapter length averages ~2000 Japanese characters, on official APIs.
- Deepseek V4.1 Flash: Under 60s on average per chapter, costing under $0.03 per chapter.
- Claude Haiku 5.5: Under 60s on average per chapter, costing under $0.5 per chapter
For cheaper translations, Deepseek V4.1 Flash (deepseek-flash) is recommended. Claude Haiku 5.5 is not recommended (fails to follow instructions commonly) and is extremely expensive.
With reasoning, it can take 5 minutes or more, and is not recommended. Local or open weight models without an official API will not be listed here as the speed will differ based on device and/or provider.
Features
- Glossary for consistent naming across chapters:
- typed entries (person, item, organization, creative work, or a custom type)
- aliases with an optional per-alias context, so one source term resolves differently by situation (e.g. a name cut off mid-speech, or depending on who speaks)
- terms are referenced by ID instead of copied as text, so editing a translation updates every chapter at once
- Context tracking to keep long stories coherent:
- rolling summary plus freeform notes
- optional per-chapter summaries that the AI can reference
- Settings-driven prompt and response schema to regenerate from your options: source/target language, creativity, footnotes, context mode, chapter summaries, and glossary/reorder permissions and limits.
- Structured model protocol - glossary add/edit/delete, chapter reordering, and context changes apply straight back into the project, and the model can request data it still needs (the chapter list, another chapter's text, …), which is fulfilled automatically:
- new chapters translate in two passes within one conversation: first the glossary, notes, and running summary are settled, then the translation is produced against the finalized names
- HTML output for a full reader (table of contents, prev/next arrows, keyboard navigation) or a single standalone chapter, with Markdown and jump-to/jump-back footnotes rendered.
- Versioned project files - the whole project can save and load as JSON.
Install
pip install wntranslate # [async] for async usage
Usage
Set up a project with a model provider. base_url can point at any OpenAI-compatible endpoint:
from wntranslate import WebNovel, TranslationSettings, Creativity, OpenAIProvider
wn = WebNovel(
"小説のタイトル", # original (source-language) title, required
"元のあらすじ", # original synopsis, required ("" if none)
settings=TranslationSettings(source_language="Japanese", target_language="English", creativity=Creativity.LOW),
provider=OpenAIProvider(model="gpt-4o-mini", api_key="sk-...", base_url="https://api.openai.com/v1"),
)
# Fill the translated title/synopsis (optional; left as None otherwise):
wn.translate_metadata()
The model is always given the glossary and your project notes, and it can request the synopsis, titles, or other chapters' text when it needs them. Notes hold project-wide facts that must stay perfectly consistent across every chapter (and that aren't glossary terms or story summary); the model keeps them updated, or you can steer them with request_change.
Translate a new chapter. This runs in two passes within one conversation: first the model updates the glossary, notes, and running summary and classifies the chapter; then, with the finalized glossary, it produces the translation. Every response is validated against the generated schema, and any data the model requests (another chapter's text, the synopsis, …) is auto-fulfilled. The newly added chapter is returned:
chapter = wn.translate_new_chapter(original_title="第1話", original_content="<source text>")
print(chapter.title)
Ask for a specific change in plain language; it is applied and returned:
wn.request_change("Rename the glossary entry 'Ayami' to 'Ayame'.")
wn.request_change("In chapter 3 only, render Ayami as 'Aya'.") # Creates a new alias in the glossary and applies it to chapter 3 only.
Read it. Export Markdown, a full HTML reader, or one standalone chapter:
print(wn.export()) # markdown
with open("book.html", "w", encoding="utf-8") as fp:
fp.write(wn.to_html()) # full reader: TOC + prev/next + footnotes
one = wn.chapter_to_html(wn.chapters[0]) # standalone chapter document
Save and load the whole project (versioned JSON):
data = wn.dumps() # compact; pass indent=2 for pretty output
restored = WebNovel.loads(data)
Building by hand
You can also populate the glossary and chapters directly instead of via the model. Every entry and alias gets a stable, auto-generated id:
from wntranslate import PersonEntry, Alias
ayami = PersonEntry(
name="Ayami",
original_name="彩美",
pronouns="she/her",
aliases=[Alias(original="彩-", translation="Aya-", context="name cut off in speech")],
)
wn.glossary.add(ayami)
wn.glossary.get(ayami.id) # by id
wn.glossary.lookup("彩美") # by name, original name, or alias
Chapter content references glossary IDs instead of raw text, so editing a term updates every chapter; IDs resolve when rendering:
from wntranslate import Chapter, Content, TextNode, TermNode, FootnoteNode
wn.chapters.append(Chapter(
original_title="第1話",
original_content="<source text>",
title="Chapter 1",
content=Content(nodes=[
TextNode(text="Hello, "),
TermNode(term_id=ayami.id), # -> "Ayami"
TextNode(text="! Or should I say "),
TermNode(term_id=ayami.id, alias_id=ayami.aliases[0].id), # -> "Aya-"
FootnoteNode(content="A play on her name."),
]),
summary="They meet for the first time.",
))
Metadata
Release files for wntranslate 1.2.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| wntranslate-1.2.4.tar.gz | 72.6 kB | With provenance | Details for wntranslate-1.2.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| wntranslate-1.2.4-py3-none-any.whl | Python 3 | none | any | Details for wntranslate-1.2.4-py3-none-any.whl |
Total release size: 136.0 kB
Release files / wntranslate-1.2.4.tar.gz
| Download URL | wntranslate-1.2.4.tar.gz |
|---|---|
| Size | 72.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8fda3523a2b76a5e070e92bfdef01280ec8bfde581996b6734f1a8f4a0ff5fc6
|
|
BLAKE2b-256 checksum How to use checksums |
55b80eaf47b7df0ee1d79374ead4256d8217bf02cbd1f86d13500065af375591
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.
Transparency logRelease files / wntranslate-1.2.4-py3-none-any.whl
| Download URL | wntranslate-1.2.4-py3-none-any.whl |
|---|---|
| Size | 63.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
65ced2b1ecb334beb06b655bcbddf93b909d7f01741c37a2f7f644bbe606ae83
|
|
BLAKE2b-256 checksum How to use checksums |
c967bd17bf7033caab426256f287df3cdf3cc482f23c44f92c5241bbae0ff147
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.
Transparency logSecurity for wntranslate 1.2.4
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for wntranslate-1.2.4.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.
Transparency logA 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.