Skip to main content

hondana 本棚

中文 · 日本語

Small, dependency-free Python helpers for matching Japanese / CJK book metadata.

If you've built book search you've seen it: the user types 图书馆, the record says 圖書館; someone types ハリー ポッター, the title is ハリー・ポッター. hondana folds these into one comparison key. It also ships a tiny ISBN lookup that falls back openBD → NDL Search → Google Books → Open Library.

Early skeleton: the character tables are a small starter set — enough to show the idea, not full coverage. Pairs welcome.

Install

pip install git+https://github.com/Jasonin2099/hondana

Use

from hondana import fold, to_isbn13, hyphenate, lookup

fold("圖書館") == fold("图书馆") == fold("図書館")   # True
fold("ハリー・ポッター") == fold("はりー ぽったー")         # True
to_isbn13("4-00-310101-4")                           # '9784003101018'
hyphenate("9784003101018")                           # '978-4-00-310101-8' (978-0/1, 978-4, 978-7, 978-957/986)

book = lookup("9784003101018")    # hits the network; None if nobody knows it
print(book.title, book.source)

CLI: python -m hondana fold "ABC 入門" · python -m hondana fold --explain "ハリー・ポッター" (every step) · python -m hondana isbn 9784003101018

What fold() does

  1. NFKC (full-width ASCII → half, half-width kana → full)
  2. kyujitai / traditional / simplified → shinjitai (small table in _tables.py)
  3. katakana → hiragana, drop the long-vowel mark ー (opt-in: small_kana=True also folds ぁ→あ, っ→つ; iteration_marks="expand"/"drop" handles 々 ゝ ゞ; itaiji=True folds variant kanji common in names, 髙→高, 﨑→崎; dashes=True unifies long-vowel marks, tildes and dash variants, コ─ヒ─→コーヒー)
  4. casefold, drop spaces, punctuation and 「」『』 brackets

Every step can be switched off (fold(s, kana=False) etc.). Simplified characters that are a different everyday Japanese character (机 vs 機, 干, 后, 叶) are left out on purpose.

Why not just NFKC? See docs/why-not-nfkc.md.

ISBN lookup

Each source is tried independently, so one timeout doesn't skip the rest. Pass your own fetch(url, params, timeout) -> (status, text) to use another HTTP client, add caching, or stub the network in tests. cached(fetch, ttl=3600) wraps any fetch with an in-memory TTL cache: lookup(isbn, fetch=cached()).

Tests

pip install pytest && python -m pytest -q

Roadmap: ROADMAP.md · MIT License

Metadata

Release files for hondana-ja 0.1.0

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

Source distribution (sdist)

Source distribution for hondana-ja 0.1.0
File Size Uploaded Provenance Actions
hondana_ja-0.1.0.tar.gz 25.5 kB With provenance Details for hondana_ja-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hondana-ja 0.1.0
File Interpreter ABI Platform Actions
hondana_ja-0.1.0-py3-none-any.whl Python 3 none any Details for hondana_ja-0.1.0-py3-none-any.whl

Total release size: 44.1 kB

Release files / hondana_ja-0.1.0.tar.gz

Download URL hondana_ja-0.1.0.tar.gz
Size 25.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c1da103ba0c5287d8d210da4334ed437e20945c85a268526d5859f48b7a1aeac
BLAKE2b-256 checksum
How to use checksums
005f5be8023f8d3fc579227ee11956ed034b070c169ba335104b9d755cea3ff6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 6, 2026.

Transparency log

Release files / hondana_ja-0.1.0-py3-none-any.whl

Download URL hondana_ja-0.1.0-py3-none-any.whl
Size 18.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e9d24f53bcd3a892531e92369175732a1fb9456ea7c5c99576e6208ef9fcb371
BLAKE2b-256 checksum
How to use checksums
0cf23ce07b7d20e365a12f833752fa8a9220f78704242b97324c4bfe0c660d6f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 6, 2026.

Transparency log

Security for hondana-ja 0.1.0

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.

Select from 2 files

Attestation for hondana_ja-0.1.0.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 Nov 6, 2026.

Transparency log

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.

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