{"id":17160204,"url":"https://github.com/obfusk/kanjidraw","last_synced_at":"2025-06-14T13:03:02.558Z","repository":{"id":50521682,"uuid":"365739904","full_name":"obfusk/kanjidraw","owner":"obfusk","description":"kanjidraw - handwritten kanji recognition library + gui","archived":false,"fork":false,"pushed_at":"2022-07-29T18:45:15.000Z","size":663,"stargazers_count":25,"open_issues_count":12,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-14T13:02:50.260Z","etag":null,"topics":["draw","gui","handwriting","japanese","kanji","library","recognition"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/obfusk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.AGPLv3","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"ko_fi":"obfusk"}},"created_at":"2021-05-09T11:49:05.000Z","updated_at":"2025-05-03T22:23:22.000Z","dependencies_parsed_at":"2022-08-29T08:40:19.776Z","dependency_job_id":null,"html_url":"https://github.com/obfusk/kanjidraw","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/obfusk/kanjidraw","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obfusk%2Fkanjidraw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obfusk%2Fkanjidraw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obfusk%2Fkanjidraw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obfusk%2Fkanjidraw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/obfusk","download_url":"https://codeload.github.com/obfusk/kanjidraw/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obfusk%2Fkanjidraw/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259820787,"owners_count":22916544,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["draw","gui","handwriting","japanese","kanji","library","recognition"],"created_at":"2024-10-14T22:24:03.163Z","updated_at":"2025-06-14T13:03:02.509Z","avatar_url":"https://github.com/obfusk.png","language":"Python","funding_links":["https://ko-fi.com/obfusk"],"categories":[],"sub_categories":[],"readme":"\u003c!-- {{{1\n\n    File        : README.md\n    Maintainer  : FC Stegerman \u003cflx@obfusk.net\u003e\n    Date        : 2022-07-26\n\n    Copyright   : Copyright (C) 2022  FC Stegerman\n    Version     : v0.2.3\n    License     : AGPLv3+\n\n}}}1 --\u003e\n\n[![GitHub Release](https://img.shields.io/github/release/obfusk/kanjidraw.svg?logo=github)](https://github.com/obfusk/kanjidraw/releases)\n[![PyPI Version](https://img.shields.io/pypi/v/kanjidraw.svg)](https://pypi.python.org/pypi/kanjidraw)\n[![Python Versions](https://img.shields.io/pypi/pyversions/kanjidraw.svg)](https://pypi.python.org/pypi/kanjidraw)\n[![CI](https://github.com/obfusk/kanjidraw/workflows/CI/badge.svg)](https://github.com/obfusk/kanjidraw/actions?query=workflow%3ACI)\n[![AGPLv3+](https://img.shields.io/badge/license-AGPLv3+-blue.svg)](https://www.gnu.org/licenses/agpl-3.0.html)\n[![Sponsor](https://img.shields.io/badge/%E2%99%A5-support-violet.svg)](https://ko-fi.com/obfusk)\n\n\u003ca href=\"https://repology.org/project/kanjidraw/versions\"\u003e\n  \u003cimg src=\"https://repology.org/badge/vertical-allrepos/kanjidraw.svg?header=\"\n    alt=\"Packaging status\" align=\"right\" /\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://repology.org/project/python:kanjidraw/versions\"\u003e\n  \u003cimg src=\"https://repology.org/badge/vertical-allrepos/python:kanjidraw.svg?header=\"\n    alt=\"Packaging status\" align=\"right\" /\u003e\n\u003c/a\u003e\n\n# kanjidraw\n\n## handwritten kanji recognition\n\n`kanjidraw` is a simple Python library + GUI for matching (the strokes\nof a) handwritten kanji against its database.\n\nYou can use the GUI to draw and subsequently select a kanji from the\nlist of probable matches, which will then be copied to the clipboard.\n\nThe database is based on KanjiVG and the algorithms are based on the\n[Kanji draw](https://github.com/onitake/kanjirecog) Android app.\n\n## Demo\n\n[Jiten Japanese Dictionary](https://jiten.obfusk.dev)\nuses `kanjidraw` with a\n[JavaScript frontend](https://github.com/obfusk/jiten/blob/master/jiten/static/kanjidraw.js).\n\n## Installing\n\n### Debian\n\nOfficial packages are available in\n[Debian unstable](https://packages.debian.org/unstable/kanjidraw)\nand\n[Ubuntu jammy](https://packages.ubuntu.com/jammy/kanjidraw).\n\n```bash\n$ apt install kanjidraw\n```\n\nYou can also manually build a Debian package using the `debian/sid`\nbranch, or download pre-built `.deb`s via GitHub releases.\n\n### NixOS\n\nAn official package is also available in\n[nixpkgs unstable](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/misc/kanjidraw/default.nix).\n\n### Using pip\n\n```bash\n$ pip install kanjidraw\n```\n\nNB: depending on your system you may need to use e.g. `pip3 --user`\ninstead of just `pip`.\n\n### From git\n\nNB: this installs the latest development version, not the latest\nrelease.\n\n```bash\n$ git clone https://github.com/obfusk/kanjidraw.git\n$ cd kanjidraw\n$ pip install -e .\n```\n\nNB: you may need to add e.g. `~/.local/bin` to your `$PATH` in order\nto run `kanjidraw`.\n\nTo update to the latest development version:\n\n```bash\n$ cd kanjidraw\n$ git pull --rebase\n```\n\n## Dependencies\n\n* Python \u003e= 3.5 (w/ Tk support for the GUI).\n\n### Debian/Ubuntu\n\n```bash\n$ apt install python3-tk\n```\n\n## Examples\n\n### Kanji Input on Linux\n\n#### kanjidraw-paste\n\nOpens `kanjidraw` to select one (`--oneshot`) or multiple\n(`--multiple`) kanji, and afterwards pastes the selected kanji in the\nactive window.  Requires `xclip` and `xdotool`.\n\n```bash\n#!/bin/bash\nset -e\npid=\"$( xdotool getactivewindow getwindowpid )\"\npids() { xdotool search --classname \"$1\" getwindowpid %@; }\nif pids rxvt | grep -q \"^$pid$\"; then\n  key=ctrl+alt+v\nelif ( pids terminal; pids st-256color ) | grep -q \"^$pid$\"; then\n  key=ctrl+shift+v\nelse\n  key=ctrl+v\nfi\nkanjidraw -s \"$@\" | tr -d '\\n' | xclip -i -selection clipboard\nxdotool key --delay 250 \"$key\"\n```\n\n#### i3 config\n\nKeybindings for i3.  Creating custom keybindings for `kanjidraw-paste\n--oneshot` and/or `kanjidraw-paste --multiple` should work similarly\nwith other window managers and desktop environments.\n\n```\nfor_window [title=\"Kanji Draw\"] floating enable\nbindsym $mod+Control+k exec --no-startup-id kanjidraw-paste --oneshot\nbindsym $mod+Control+m exec --no-startup-id kanjidraw-paste --multiple\n```\n\n## Miscellaneous\n\n### GUI Options\n\n```bash\n$ kanjidraw --help\nusage: kanjidraw [-h] [-s] [-o | -m] [-d] [--version]\n\noptional arguments:\n  -h, --help      show this help message and exit\n  -s, --stdout    print kanji to stdout instead of copying to clipboard\n  -o, --oneshot   quit after one kanji\n  -m, --multiple  queue kanji and copy/print after pressing 'c' or quitting\n  -d, --dark      use dark theme\n  --version       show program's version number and exit\n```\n\nAdditional keybindings: `q` to quit, `\u003cesc\u003e` to go back.\n\n### Enabling Dark Mode\n\n```bash\n$ export KANJIDRAW_DARK=1\n```\n\n### Disabling the Grid\n\n```bash\n$ export KANJIDRAW_NOGRID=1\n```\n\n## License\n\n### Code\n\n© FC Stegerman\n\n[![AGPLv3+](https://www.gnu.org/graphics/agplv3-155x51.png)](https://www.gnu.org/licenses/agpl-3.0.html)\n\n### KanjiVG (stroke data)\n\n© Ulrich Apel\n\n[![CC-BY-SA](https://licensebuttons.net/l/by-sa/3.0/88x31.png)](https://github.com/KanjiVG/kanjivg/blob/master/COPYING)\n\n\u003c!-- vim: set tw=70 sw=2 sts=2 et fdm=marker : --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobfusk%2Fkanjidraw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fobfusk%2Fkanjidraw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobfusk%2Fkanjidraw/lists"}