Quickstart

unihan-etl downloads the Unicode UNIHAN database and exports it to CSV, JSON, or YAML. A plain unihan-etl export works out of the box — the download is cached for reuse.

Installation

Ensure you have at least Python >= 3.10.

Using uv:

$ uv add unihan-etl

Run the CLI once without a persistent install via uvx:

$ uvx unihan-etl

Using pip:

$ pip install --user unihan-etl

You can upgrade to the latest release with:

$ pip install --user --upgrade unihan-etl

Developmental releases

unihan-etl publishes alpha, beta, and release-candidate versions to PyPI. Their version numbers carry a1, b1, and rc1 suffixes, respectively. For example, 0.27.0a1 is the first alpha release of 0.27.0 before general availability.

  • uv:

    $ uv add unihan-etl --prerelease allow
    
  • pip:

    $ pip install --user --upgrade --pre unihan-etl
    
  • pipx:

    $ pipx install --suffix=@next 'unihan-etl' --pip-args '\--pre' --force
    

    Then run unihan-etl@next export.

  • uv tool install:

    $ uv tool install --prerelease allow unihan-etl
    
  • uvx:

    $ uvx --from 'unihan-etl' --prerelease allow unihan-etl
    

    Then rerun with your desired arguments, e.g. uvx --prerelease allow unihan-etl export.

via trunk (can break easily):

  • pip:

    $ pip install --user -e git+https://github.com/cihai/unihan-etl.git#egg=unihan-etl
    
  • pipx:

    $ pipx install --suffix=@master 'unihan-etl @ git+https://github.com/cihai/unihan-etl.git@master' --force
    
  • uvx*:

    $ uvx --from git+https://github.com/cihai/unihan-etl.git@master unihan-etl
    

    *uvx --from lets you run directly from a VCS URL.

Commands

Run unihan-etl without arguments to list its subcommands; the CLI reference documents each one.

$ unihan-etl

Pythonics

For the rarer cases, you can drive the same pipeline from Python — see the API reference for Packager and Options.