Skip to main content

ideograph

A tool to look up ideographs by their components. At the moment, it only contains Han characters, but it could be expanded to include other ideographic scripts such as Tangut or Sumero-Akkadian Cuneiform.

Installation

$ pip install ideograph

Usage

ideograph consists of a two functions, find() and components():

find() takes a string of ideograph components and returns a set of ideographs that include all of those components.

Characters in the component string that are not ideographic components are ignored.

Note that the current implementation is quite strict and relies on visual distinction for components rather than etymological connection: e.g. "人" ≠ "亻".

It can be called from the command line:

$ ideograph 木日勿
䵘楊鸉𣝻𣿘𥂸𥠜𦼴𩁒𪳷𬬍

or imported as a Python package:

>>> import ideograph
>>> ideograph.find("木日勿")
{'𣿘', '𣝻', '𥠜', '𪎥', '𩁒', '𪎧', '𥟘', '𣓗', '楊', '𣓾', '𬬍', '𪳷', '𦼴', '鸉', '䵘', '𥂸'}

components() takes a string consisting of a single ideograph and returns a set of components. Note that the set contains components and the components of those components, and so on, down to the most basic of components contained in the cjkvi-ids data set.

>>> import ideograph
>>> ideograph.components("楊")
{'日', '木', '昜', '一', '勿', '旦', '勹', '丿', '\uf3e4'}

Data

Character components are derived from the cjkvi-ids database (included in this Git repository as a submodule), specifically the ids-cdp.txt data file. As some components do not currently have a Unicode code point assigned to them, they are given code points in the Private Use Area of Unicode. Note that because of this, some of these characters may be returned by the find() and components() functions.

Data is stored in a sqlite3 database, which can be regenerated from cjkvi-ids data by running the generate_data.py script.

Metadata

Release files for ideograph 1.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 ideograph 1.1.0
File Size Uploaded Provenance Actions
ideograph-1.1.0.tar.gz 5.2 MB Without provenance Details for ideograph-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ideograph 1.1.0
File Interpreter ABI Platform Actions
ideograph-1.1.0-py3-none-any.whl Python 3 none any Details for ideograph-1.1.0-py3-none-any.whl

Total release size: 10.3 MB

Release files / ideograph-1.1.0.tar.gz

Download URL ideograph-1.1.0.tar.gz
Size 5.2 MB
Tags Source
SHA-256 checksum
How to use checksums
f668735a6295c53512a7c93feffd1a66f3f283fbbc9d74cae99cb9c3d45f1d81
BLAKE2b-256 checksum
How to use checksums
45b81624a658191933a90b9795c01116a94d72a9664ba6c688ffd2e6d4c48a62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

Release files / ideograph-1.1.0-py3-none-any.whl

Download URL ideograph-1.1.0-py3-none-any.whl
Size 5.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
5ddb72777b95afecc11c43230a8d19b8aed348a4b683c0b47f2dfae59b0d1a0d
BLAKE2b-256 checksum
How to use checksums
c7bca28dc6d604be67d122836c769bd6da0e017059b34e8d7cb62a93764c5cf1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

Security for ideograph 1.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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