# Changelog

You can test the unpublished version of cihai before it's released, see
[developmental releases](https://cihai.git-pull.com/quickstart.html#developmental-releases).

[pip](https://pip.pypa.io/en/stable/):

```console
$ pip install --user --upgrade --pre cihai
```

[pipx](https://pypa.github.io/pipx/docs/):

```console
$ pipx run --pip-args '\--pre' --spec 'cihai' python -c "import cihai; print(cihai.__version__)"
```

[uv](https://docs.astral.sh/uv/getting-started/features/#python-versions):

```console
$ uv add cihai --prerelease allow
```

[uvx](https://docs.astral.sh/uv/guides/tools/):

```console
$ uvx --from 'cihai' --prerelease allow python -c "import cihai; print(cihai.__version__)"
```

## cihai 0.37.x (unreleased)

<!-- Maintainers, insert changes / features for the next release here -->

_Add your latest changes from PRs here_

## cihai 0.36.1 (2026-01-24)

### Breaking changes

- Bump unihan-etl v0.38.0 -> v0.39.1 (#389)

### CI

- Migrate to PyPI Trusted Publisher (#387)

### Development

#### Makefile -> Justfile (#388)

- Migrate from `Makefile` to `justfile` for running development tasks
- Update documentation to reference `just` commands

### Documentation

- Migrate docs deployment to AWS OIDC authentication and AWS CLI

## cihai 0.36.0 (2025-11-01)

### Breaking changes

- Bump unihan-etl v0.37.0 -> v0.38.0
- Drop support for Python 3.9; the new minimum is Python 3.10 (#386).

  See also:
  - [Python 3.9 EOL timeline](https://devguide.python.org/versions/#:~:text=Release%20manager-,3.9,-PEP%20596)
  - [PEP 596](https://peps.python.org/pep-0596/)

### Development

- Add Python 3.14 to test matrix (#385)

#### chore: Implement PEP 563 deferred annotation resolution (#383)

- Add `from __future__ import annotations` to defer annotation resolution and reduce unnecessary runtime computations during type checking.
- Enable Ruff checks for PEP-compliant annotations:
  - [non-pep585-annotation (UP006)](https://docs.astral.sh/ruff/rules/non-pep585-annotation/)
  - [non-pep604-annotation (UP007)](https://docs.astral.sh/ruff/rules/non-pep604-annotation/)

For more details on PEP 563, see: https://peps.python.org/pep-0563/

## cihai 0.35.0 (2024-12-21)

_Maintenance only, no bug fixes, or new features_

### Breaking changes

- Drop Python 3.8 (#382)

  The minimum version of Python in this and future releases is Python 3.9.

  Python 3.8 reached end-of-life status on October 7th, 2024 (see PEP 569).
- unihan-etl 0.37.0 minimum (#382)

  Python 3.9 minimum version.

### Development

- Aggressive automated lint fixes via `ruff` (#382)

  via ruff v0.8.4, all automated lint fixes, including unsafe and previews were applied for Python 3.9:

  ```sh
  ruff check --select ALL . --fix --unsafe-fixes --preview --show-fixes; ruff format .
  ```

## cihai 0.34.0 (2024-11-26)

### Breaking changes

#### Project and package management: poetry to uv (#380)

[uv] is the new package and project manager for the project, replacing Poetry.

[uv]: https://github.com/astral-sh/uv

#### Build system: poetry to hatchling (#380)

[Build system] moved from [poetry] to [hatchling].

[Build system]: https://packaging.python.org/en/latest/tutorials/packaging-projects/#choosing-a-build-backend
[poetry]: https://github.com/python-poetry/poetry
[hatchling]: https://hatch.pypa.io/latest/

### Development

- Remove `kFrequency` per UNIHAN Revision 37

  - https://www.unicode.org/L2/L2024/24006.htm#178-C17
  - https://www.unicode.org/reports/tr38/tr38-37.html#ChronologicalListing

- Code quality: Use f-strings in more places (#371)

  via [ruff 0.4.2](https://github.com/astral-sh/ruff/blob/v0.4.2/CHANGELOG.md).

[uv]: https://github.com/astral-sh/uv

## cihai 0.33.0 (2024-04-06)

_Maintenance only, no bug fixes, or new features_

### Documentation

- Automatically linkify links that were previously only text.

### Development

- Aggressive automated lint fixes via `ruff` (#369)

  via ruff v0.3.4, all automated lint fixes, including unsafe and previews were applied:

  ```sh
  ruff check --select ALL . --fix --unsafe-fixes --preview --show-fixes; ruff format .
  ```

  Branches were treated with:

  ```sh
  git rebase \
      --strategy-option=theirs \
      --exec 'poetry run ruff check --select ALL . --fix --unsafe-fixes --preview --show-fixes; poetry run ruff format .; git add src tests; git commit --amend --no-edit' \
      origin/master
  ```

## cihai 0.32.0 (2024-04-01)

_Maintenance only, no bug fixes, or new features_

### Development

- unihan-etl -> 0.30.1 -> 0.34.0
- poetry: 1.7.1 -> 1.8.2

  See also: https://github.com/python-poetry/poetry/blob/1.8.2/CHANGELOG.md

- ruff 0.2.2 -> 0.3.0 (#368)

  Related formattings. Update CI to use `ruff check .` instead of `ruff .`.

  See also: https://github.com/astral-sh/ruff/blob/v0.3.0/CHANGELOG.md

## cihai 0.31.0 (2024-02-09)

### What's new

- Bump UNIHAN compatibility from 11.0.0 to [15.1.0](https://www.unicode.org/reports/tr38/tr38-35.html#History) (released 2023-09-01, revision 35).
- unihan-etl: 0.29.0 -> 0.33.1

  - Bump unihan-etl 0.30.1 -> 0.33.1 (#366)

    UNIHAN compatibility bumped to 15.1.0.

  - Bump unihan-etl 0.29.0 -> 0.30.1

    Fix `kRSUnicode` double apostrophes.

### Development

- Strengthen linting (#367)

  - Add flake8-commas (COM)

    - https://docs.astral.sh/ruff/rules/#flake8-commas-com
    - https://pypi.org/project/flake8-commas/

  - Add flake8-builtins (A)

    - https://docs.astral.sh/ruff/rules/#flake8-builtins-a
    - https://pypi.org/project/flake8-builtins/

  - Add flake8-errmsg (EM)

    - https://docs.astral.sh/ruff/rules/#flake8-errmsg-em
    - https://pypi.org/project/flake8-errmsg/

### Documentation

- API docs: Split into multiple pages (#363)

## cihai 0.30.0 (2023-12-09)

### Bug fixes

- `gb2312_to_euc()`: Fix `AssertionError` (#361)
- `kuten_to_gb2312()`: Fix `AssertionError` (#361)

### CI

- Move CodeQL from advanced configuration file to GitHub's default
- ci: Add pydocstyle rule to ruff (#361)

### Documentation

- Add docstrings to functions, methods, classes, and packages (#361)

## cihai 0.29.0 (2023-11-19)

_Maintenance only, no bug fixes, or new features_

### Packaging

- Move pytest configuration to `pyproject.toml` (#357)
- Bump Python 3.12 trove classifiers
- Packaging (poetry): Fix development dependencies

  Per [Poetry's docs on managing dependencies] and `poetry check`, we had it wrong: Instead of using extras, we should create these:

  ```toml
  [tool.poetry.group.group-name.dependencies]
  dev-dependency = "1.0.0"
  ```

  Which we now do.

  [Poetry's docs on managing dependencies]: https://python-poetry.org/docs/master/managing-dependencies/

- CI: Update action packages to fix warnings

  - [dorny/paths-filter]: 2.7.0 -> 2.11.1

  [dorny/paths-filter]: https://github.com/dorny/paths-filter

### Development

- unihan-etl: 0.28.0 -> 0.29.0

  Move from `black` to `ruff format`, CI and dev package updates

- ruff: Remove ERA / `eradicate` plugin

  This rule had too many false positives to trust. Other ruff rules have been beneficial.

- Poetry: 1.6.1 -> 1.7.0

  See also: https://github.com/python-poetry/poetry/blob/1.7.0/CHANGELOG.md

- Move formatting from `black` to [`ruff format`] (#360)

  This retains the same formatting style of `black` while eliminating a
  dev dependency by using our existing rust-based `ruff` linter.

  [`ruff format`]: https://docs.astral.sh/ruff/formatter/

## cihai 0.28.0 (2023-07-22)

_Maintenance only, no bug fixes, or new features_

### Development

- unihan-etl: 0.27.0 -> 0.28.0

  pytest fixture renamings

## cihai 0.27.0 (2023-07-18)

### Bug fixes

- ci: Fix for tests (#355)
- unihan-etl:

  - 0.26.0 -> 0.27.0 (#355)

    Fix for pytest fixtures

  - 0.25.0 -> 0.26.0

    pytest plugin with cached UNIHAN data.

### Development

- ruff: code quality improvements (#354)

## cihai 0.26.0 (2023-07-01)

_Maintenance only, no bug fixes, or new features_

### Development

- Ruff: Add additional rules, fix linting issues (#353)
- unihan-etl: 0.24.0 -> 0.25.0 (ruff typing updates)

## cihai 0.25.0 (2023-06-24)

_Maintenance only, no bug fixes, or new features_

### Development

- unihan-etl: 0.23.1 -> 0.24.0 (#352)

  Subdependency updated for zhon: 1.1.5 -> 2.0.0

  [zhon 2.0's Release notes](https://github.com/tsroten/zhon/blob/v2.0.0/CHANGES.rst#v200-2023-06-24)

  Fixes pytest warning related to regular expressions.

## cihai 0.24.0 (2023-06-24)

_Maintenance only, no bug fixes, or new features_

### Development

- unihan-etl: 0.22.1 -> 0.23.0 (#351)

  Package introduces configurable application directories (for test purposes)

## cihai 0.23.0 (2023-06-19)

_Maintenance only, no bug fixes, or new features_

### Internal improvements

- unihan-etl: 0.21.1 -> 0.22.1 (#348):

  {obj}`dataclasses.dataclass`-based configuration

## cihai 0.22.1 (2023-06-18)

### Bug fix

- unihan-etl: Bump 0.21.0 -> 0.21.1

  Fix file extensions of output files

## cihai 0.22.1 (2023-06-18)

_Maintenance only, no bug fixes, or new features_

### Development

- unihan-etl: Updates

  - 0.19.2 -> 0.20.0: Drops python 3.7, normalizes `typing` imports
  - 0.20.0 -> 0.21.0: Moves to {mod}`pathlib` (#349)

## cihai 0.21.0 (2023-06-03)

### Breaking changes

- SQLAlchemy: Upgraded to v2 (#340)

  Downstream packages will require SQLAlchemy v2 at a minimum.

  Benefits in include: Built-in types for mypy, being able to use SQLAlchemy
  core API against ORM entities.

  See also: [What's new in SQLAlchemy
  2.0](https://docs.sqlalchemy.org/en/20/changelog/whatsnew_20.html),
  [Migrating to SQLAlchemy
  2.0](https://docs.sqlalchemy.org/en/20/changelog/migration_20.html)

### Development

- Move from pytest's `tmp_dir` (`py.path.local`) to `tmp_path` (`pathlib.Path`),
  #346
- Remove unnecessary use of `typing_extension`'s `TypedDict` (#346)

  Note: `typing_extension`'s `TypedDict` is still
  used for `NotRequired` `TypedDict`s until the minimum python version supports
  them ([3.11](https://www.python.org/downloads/release/python-3110/) via [PEP-655](https://peps.python.org/pep-0655/))

## cihai 0.20.0 (2023-05-29)

### Breaking changes

- **Python 3.7 Dropped**

  Python 3.7 support has been dropped (#343)

  Its end-of-life is June 27th, 2023 and Python 3.8 will add support for
  `typing.TypedDict` and `typing.Protocol` out of the box without needing
  `typing_extensions`.

### Development

- **Improved typings**

  Move to strict mypy typings (#324)

  This will make future refactoring simplifications easier and maintain code
  quality in the long term, in addition to more intelligent completions.

  [`mypy --strict`]: https://mypy.readthedocs.io/en/stable/command_line.html#cmdoption-mypy-strict

## cihai 0.19.0 (2023-05-28)

_Maintenance only, no bug fixes, or new features_

### Internal improvements

- Move formatting, import sorting, and linting to [ruff].

  This rust-based checker has dramatically improved performance. Linting and
  formatting can be done almost instantly.

  This change replaces isort, flake8 and flake8 plugins.

- poetry: 1.4.0 -> 1.5.0

  See also: https://github.com/python-poetry/poetry/releases/tag/1.5.0

- unihan-etl: 0.18.2 -> 0.19.1: Dev dependency updates

[ruff]: https://ruff.rs

## cihai 0.18.3 (2023-05-13)

_Maintenance only release, no bug fixes, changes, or features._

### Packaging

- Bump unihan-etl from 0.18.1 -> 0.18.2

  Typing update for `merge_dict`

### Development

- Chore: flake8 fixes

## cihai 0.18.2 (2022-10-02)

**Maintenance only release, no bug fixes, or new features**

### Packaging

- Bump unihan-etl from 0.18.0 -> 0.18.1 (just packaging updates)
- Pin `importlib_metadata` to `<5` while internal dependencies are figured out

## cihai 0.18.1 (2022-10-01)

### Packaging

- Add PyYAML dependency

## cihai 0.18.0 (2022-10-01)

### Breaking changes

- Remove kaptan dependency (#334)
- Remove support for `.ini` configurations (#334)

## cihai 0.17.1 (2022-10-01)

### Infrastructure

- CI speedups (#333)

  - Split out release to separate job so the PyPI Upload docker image isn't pulled on normal runs
  - Clean up CodeQL

- poetry: Bump 1.1.x to 1.2.x

## cihai 0.17.0 (2022-09-11)

**Maintenance only release, no bug fixes, or new features**

### Development

- Move to to `src/` layout (#331)
- Add [flake8-bugbear](https://github.com/PyCQA/flake8-bugbear) (#328)
- Add [flake8-comprehensions](https://github.com/adamchainz/flake8-comprehensions) (#329)

### Documentation

- Render changelog in [`linkify_issues`] (~~#327~~, #330)
- Fix Table of contents rendering with sphinx autodoc with [`sphinx_toctree_autodoc_fix`] (#330)
- Test doctests in our docs via [`pytest_doctest_docutils`] (built on [`doctest_docutils`]) (#330)

[`linkify_issues`]: https://gp-libs.git-pull.com/linkify_issues/
[`sphinx_toctree_autodoc_fix`]: https://gp-libs.git-pull.com/sphinx_toctree_autodoc_fix/
[`pytest_doctest_docutils`]: https://gp-libs.git-pull.com/doctest/pytest.html
[`doctest_docutils`]: https://gp-libs.git-pull.com/doctest

## cihai 0.16.0 (2022-08-21)

Purely on the inside. We're adding comprehensive type annotations to all cihai
projects for better maintainability and downstream usage.

### Internal

- Update unihan-etl 0.16.0 -> 0.17.2:

  - unihan-etl 0.16.0 adds `--no-cache` / `cache` as an option
  - unihan-etl 0.17.0 adds type annotations (`mypy --strict`)
  - unihan-etl 0.17.1 fixes bugs from 0.17.0's annotations
  - unihan-etl 0.17.2 docs / changelog issue linking update

## cihai 0.15.0 (2022-08-20)

### Breaking changes

The CLI version of `cihai` installed through `cihai-cli` again

Before (cihai 0.9 to 0.14, cihai-cli 0.5 to 0.10):

```console
$ pip install cihai[cli]
```

After (cihai 0.15+, cihai-cli 0.11+):

```console
$ pip install cihai-cli
```

This made deploying cihai + cihai-cli and pinning packages extremely laborious.

We can reinvestigate this model in the future.

via: **[cihai#326](https://github.com/cihai/cihai/pull/326)**, [cihai-cli#279](https://github.com/cihai/cihai-cli/pull/279)

## cihai 0.14.1 (2022-08-20)

- Bump cihai-cli to 0.10.0

  And maybe we'll turn cihai into libcihai down the road and remove `cihai[cli]`

## cihai 0.14.0 (2022-08-20)

### Breaking changes

- Python 2 compatibility module and imports removed. Python 2.x was officially
  dropped in 0.11.0 (2021-06-15) via #325

  - Update `import_string()` and `ImportStringError` to latest from werkzeug
  - Use `merge_dict` from `unihan_etl`
  - Bump unihan-etl to 0.15.0+ (to avoid any chance of using compat imports from
    it in the future)

## cihai 0.13.0 (2022-08-16)

### Compatibility

- Add python 3.10 support (#317)
- Remove python 3.6 support (#317)

### Development

Infrastructure updates for static type checking and doctest examples.

- Update poetry to 1.1
  - CI: Use poetry 1.1.12 and `install-poetry.py` installer (#296 + #317)
  - Relock poetry.lock at 1.1 (w/ 1.1.7's fix)
- Initial [doctests] support added, via #323

  [doctests]: https://docs.python.org/3/library/doctest.html

- Initial [mypy] validation, via #323

  [mypy]: https://github.com/python/mypy

- CI (tests, docs): Improve caching of python dependencies via
  `action/setup-python`'s v3/4's new poetry caching, via #323

- CI (docs): Skip if no `PUBLISH` condition triggered, via #323

### Documentation

- Add {ref}`development workflow docs <developing>` (universal to all cihai projects)

## cihai 0.12.0 (2021-06-16)

- #291: Convert to markdown

## cihai 0.11.1 (2021-06-15)

- Fix cihai-cli and sqlalchemy versions

## cihai 0.11.0 (2021-06-15)

- Update `black` to 21.6b0
- Update trove classifiers to 3.9
- Update unihan-etl to 0.12.0 (removes python 2.7, 3.5 support)
- #288 Remove python 2.7, 3.5 support. Remove `__future__` and unused modesets

## cihai 0.10.0 (2020-08-09)

- issue Remove version constraint from cihai-cli to satisfy pip's 2020

  resolver: <https://pip.pypa.io/en/stable/user_guide/#resolver-changes-2020>

- #285 Move packaging / publishing to poetry
- #284 Self host docs
- #284 Add metadata / icons / etc. for doc site
- #284 Move travis -> github actions
- #284 Overhaul Makefiles
- #283 Move from Pipfile to poetry
- Improvements to plugin/extension system

## cihai 0.9.0p1 (2019-08-18)

- Repin requirements/cli.txt dependency, again

## cihai 0.9.0p0 (2019-08-18)

- Repin requirements/cli.txt dependency

## cihai 0.9.0 (2019-08-18)

- 0.9.0 Final released
- From here on in, cihai-cli is to be downloaded via `pip install cihai[cli]`
- See 0.9.0 releases below for more information on changes

## cihai 0.9.0a4 (2019-08-17)

- Add `project_urls` to setup.py
- Python 2/3 compatible `collections`
- Package updates (pytest to 5.1.0)
- Linting fixes

## cihai 0.9.0a (2018-09-07)

- Update pytest to 3.8.0
- Update sphinx to 1.7.9
- _util_ -> _utils_
- _conf_ -> _config_
- Add `cihai.__version__` (so the version is available without having to access `__about__`)
- Add source code link on GitHub on API pages
- Add `__github__` to `__about__`
- Move `DEFAULT_CONFIG` to _constants.py_
- Move _cihai/unihan.py_ -> _cihai/unihan/{**init**.py,dataset.py}_
- Move _cihai/bootstrap.py_ -> _cihai/unihan/bootstrap.py_
- Treat Unihan as a `Dataset`
- Automatically include dataset when created `c = Cihai()`, `c = Cihai(unihan=False)` will do
  without
- Tests for examples. We want to make sure our examples work out of the box and new changes catch
  API breaks when they need updating

## cihai 0.8.1 (2018-07-21)

- Loosen kaptan requirement to greater than 0.5.10, less than 0.6

  This should fix issues with pyyaml, as well as downstream with cihai-cli.

- Loosen other version requirements to avoid entanglements downstream in the future.
- Update Sphinx to 1.7.5 to 1.7.6
- Update releases to 1.6.0 to 1.6.1
- Update and sync Pipfile

## cihai 0.8.0 (2018-06-23)

- Update unihan-etl to 0.9.0 to 0.9.5
- Base package updates

  - sqlalchemy 1.1.10 to 1.2.8
  - kaptan 0.5.8 to 0.5.9

- Developer package updates (linting / docs / testing)

  - isort 4.2.5 to 4.3.4
  - flake8 3.3.0 to 3.5.0
  - vulture 0.14 to 0.27
  - sphinx 1.5.6 to 1.7.5
  - alagitpull 0.0.4 to 0.0.21
  - releases 1.3.1 to 1.6.0
  - pytest 3.1.0 to 3.6.2

- Move documentation over to numpy-style
- Add sphinxcontrib-napoleon 0.6.1
- Update LICENSE New BSD to MIT
- All future commits and contributions are licensed to the _cihai software foundation_. This
  includes commits by Tony Narlock (creator).

## cihai 0.7.4 (2017-05-26)

- bump unihan-tabular 0.8.1 to unihan-etl 0.9.0

## cihai 0.7.3 (2017-05-20)

- Update unihan-tabular to 0.7.3, adds _kJa_ and fixes _kCompatibilityVariant_.

## cihai 0.7.2 (2017-05-20)

- Support for character lookup and reverse lookup
- Code examples in _/examples_

## cihai 0.7.1 (2017-05-20)

- Readme updates and remove unused CLI module

## cihai 0.7.0 (2017-05-20)

- Split CLI functionality into [cihai-cli](https://cihai-cli.git-pull.com).
- Update classifiers / metadata in setup.py

## cihai 0.6.1 (2017-05-17)

- Initial support for reverse lookups
- Output cli in basic yaml

## cihai 0.6.0 (2017-05-17)

- Support for configuring logging via options and CLI
- Convert all print statements to use logger

## cihai 0.5.1 (2017-05-17)

- Python 2 CLI fix

## cihai 0.5.0 (2017-05-17)

- Remove use of singleton metadata object
- Automatically bootstrap UNIHAN on first use

## cihai 0.4.2 (2017-05-16)

- Load default configuration via internal dictionary

## cihai 0.4.1 (2017-05-16)

- Update MANIFEST.in

## cihai 0.4.0 (2017-05-16)

- Automatically reflect database schemas and make available in main cihai object
- Use click library for CLI
- Initial support for character lookups via `$ cihai info <char>`.
- #3 Bootstrap UNIHAN into cihai by default via unihan-tabular project
- #4 Drop python 3.3 and 3.4 support
- #4 Initial [XDG] base directory support
- Move tests to pytest functions and fixtures
- Remove unused test_unihan file
- PEP8, sort imports
- Move default config from _cihai/config.yml_ to _conf/default.yml_.
- Split configuration functionality into `cihai.conf`.
- Functionality for replaces, tildes, environmental variables and xdg variables in settings.
- Document CLI usage via sphinx-argparse

## cihai 0.3.0 (2017-04-16)

- Rebooted
- Modernize _Makefile_ in docs
- Add Makefile to main project
- Modernize package metadata to use _**about**.py_
- Update requirements to use _requirements/_ folder for base, testing and doc dependencies.
- Update sphinx theme to alabaster with new logo.
- Update travis to use coverall
- Update links on README to use https
- Update travis to test up to python 3.6
- Add support for pypy (why not)
- Lock base dependencies
- Add dev dependencies for isort, vulture and flake8
- Rename `cihai.cihai` to `cihai.core`

[xdg]: https://specifications.freedesktop.org/basedir-spec/basedir-spec-0.6.html

<!---
vim: set filetype=markdown:
-->
