v0.4.0 #14
svdC1
announced in
Announcements
v0.4.0
#14
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Richer data objects, a typed exception hierarchy, and a fix for the audio pull
Breaking Changes
JSON Output Shape→ The CLI--jsonoutput now followsPydantic'smodel_dump_json. Field names are unchanged and Japanese text stays verbatim,but the exact shape may differ from
0.3.0, which0.xSemVer allowsDTO Serialization→ TheSerializablemixin and itsto_dict/to_jsonhelpers are removed, serialize thePydanticDTOswithmodel_dump/model_dump_jsoninsteadBad-Argument Errors→ TheAPInow raisesAPIErrorfrom the newhierarchy on invalid arguments instead of
ValueErrorAdded
Data-Facing DTO Methods→ The data objects gained pure helpers such asJMDictEntryDTO.all_pos/common_kanji,SenseDTO.all_tags/expand_tags,KanjiDTO.skip_codes/is_joyo, andLookupResult.has_*Exception Hierarchy→ A newkotobase.exceptionsmodule rooted atKotobaseError(
DatabaseError,SourceExtractionError,DownloadError,APIErrorandtheir leaves), re-exported from the top-level package
New API Methods→words_with_kanji,sentences_with_kanjiandresolve_references(each accepting aDTOor a string), plus amatchargument on
by_radicalsto find kanji containing any of a set of radicalsas well as all of them
DTO Arguments→ The key-taking methods now accept aDTOas well as astring, reading the lookup key off the object, so a result from one call can
be passed straight into another (e.g.
sentences(entry),stroke_svg(kanji))Test Suite→ Apytestsuite run against a tiny fixture database, withcoverage reported to
CodecovacrossPython3.10 to 3.13Changed
Pydantic DTOs→ The data objects are nowPydanticmodels that carrydata-facing behaviour and are built with
model_validatestraight from theORMrowsTyped Errors→ Repositories wrap unexpected database failures asDatabaseError, and the build pipeline raisesDownloadError/SourceExtractionError. TheCLIrenders anyKotobaseErroras a friendlymessage instead of a traceback
Fixed
Audio Pull→kotobase db pullpreviously rebuilt the audio databaselocally from the
Kanji Alivesources instead of pulling the pre-builtkotobase-audio.db.zstrelease assetThis discussion was created from the release v0.4.0.
All reactions