Skip to main content

OCR snipping tool for reading manga.

Project description

Project logo

OCR application for reading manga in Japanese, made for AJATTers🇯🇵

Lancet

PyPi Chat Support

Lancet is an OCR application for reading manga in Japanese. It uses PyTorch models to recognize Japanese text in images. Lancet works best with Goldendict-ng or Rikaitan.

https://github.com/user-attachments/assets/8859adac-1bd8-435a-9c81-945f875dc205

User Guide

Prerequisites:

  • Goldendict for looking up words in Japanese dictionaries.
  • nsxiv for reading manga.

Launch Goldendict, then open a manga folder in nsxiv. Start Lancet and wait for the OCR model to load. Press the OCR shortcut (default Alt+O) to show the snipping window, then drag and hold the mouse to perform OCR.

Lancet adds an icon to the system tray. Right‑click the icon to access actions, including Preferences, where you can change the OCR shortcut.

Installation

Install via pipx from pypi.

pipx install ajt-lancet

The lancet executable will be available in your $PATH.

On Windows-like systems, you may need to add the folder containing the lancet executable to your $PATH manually.

System Requirements

Lancet depends on large Python libraries. pipx installs everything in an isolated location (~/.local/share/pipx) so you can cleanly uninstall with pipx uninstall later. The PyTorch models are downloaded from HuggingFace and saved to ~/.cache/huggingface.

  • Disk space: ~8 GiB (PyTorch and dependencies)
  • RAM: at least 2 GiB

Upgrading

Running pipx upgrade upgrades lancet to the latest version.

pipx upgrade ajt-lancet

Running pipx upgrade-all upgrades all packages installed with pipx.

pipx upgrade-all

Development Setup

Since Ajatt-Tools is a distributed effort, we highly welcome new contributors! Install the project in development mode to easily test and commit your changes using hatch.

  • Clone the repo.
  • Install hatch.
  • CD into the repo and run hatch shell.
  • Inside the hatch shell run pip install -e ..
  • To run the app, run: hatch run lancet.

Try these libre code editors with python support:

Autostart

Add the lancet command to your autostart so Lancet launches at login.

Here's an example for i3wm:

exec --no-startup-id lancet

Project details


Download files

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

Source Distribution

ajt_lancet-26.3.8.1.tar.gz (575.1 kB view details)

Uploaded Source

Built Distribution

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

ajt_lancet-26.3.8.1-py3-none-any.whl (27.6 kB view details)

Uploaded Python 3

File details

Details for the file ajt_lancet-26.3.8.1.tar.gz.

File metadata

  • Download URL: ajt_lancet-26.3.8.1.tar.gz
  • Upload date:
  • Size: 575.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ajt_lancet-26.3.8.1.tar.gz
Algorithm Hash digest
SHA256 63f192c8c18cc24712f4c997d04dd0e8916bd7edbc9c9a01eb499532489fefe6
MD5 a44be7ad1d650a53067c7246d5c0ee56
BLAKE2b-256 29f7189c071814de68de1ed10631e87fbef42a6ceeb81f8659c759bf09f436be

See more details on using hashes here.

Provenance

The following attestation bundles were made for ajt_lancet-26.3.8.1.tar.gz:

Publisher: release.yml on Ajatt-Tools/lancet

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ajt_lancet-26.3.8.1-py3-none-any.whl.

File metadata

  • Download URL: ajt_lancet-26.3.8.1-py3-none-any.whl
  • Upload date:
  • Size: 27.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ajt_lancet-26.3.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2943eb511a09585614191fbac73006588f31a351ff68fe8d02f2a4c88cb7c72a
MD5 2c5d534005bb3f6f9259683776897813
BLAKE2b-256 2ab604bfd7d46984c067c35b0f48a1a8d228655297bc542c7b5b2a8f9725b702

See more details on using hashes here.

Provenance

The following attestation bundles were made for ajt_lancet-26.3.8.1-py3-none-any.whl:

Publisher: release.yml on Ajatt-Tools/lancet

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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