Commands

Export UNIHAN data of Chinese, Japanese, Korean to CSV, JSON or YAML

usage: unihan-etl [-h] [-v] [-s SOURCE] [-z ZIP_PATH] [-d DESTINATION]
                  [-w WORK_DIR] [-F {json,csv,yaml}] [--no-expand]
                  [--no-prune] [--no-cache] [-f [FIELDS ...]]
                  [-i [INPUT_FILES ...]]
                  [-l {DEBUG,INFO,WARNING,ERROR,CRITICAL}]

Named Arguments

-v, --version

show program’s version number and exit

-s, --source

URL or path of zipfile. Default: http://www.unicode.org/Public/UNIDATA/Unihan.zip

-z, --zip-path

Path the zipfile is downloaded to. Default: /home/runner/.cache/unihan_etl/downloads/Unihan.zip

-d, --destination

Output of .csv. Default: /home/runner/.local/share/unihan_etl/unihan.{json,csv,yaml}

-w, --work-dir

Default: /home/runner/.cache/unihan_etl/downloads

-F, --format

Possible choices: json, csv, yaml

Default: csv

--no-expand

Don’t expand values to lists in multi-value UNIHAN fields. Doesn’t apply to CSVs.

Default: True

--no-prune

Don’t prune fields with empty keysDoesn’t apply to CSVs.

Default: True

--no-cache

Don’t cache the UNIHAN zip file or CSV outputs.

Default: True

-f, --fields

Fields to use in export. Separated by spaces. All fields used by default. Fields: kAccountingNumeric, kAlternateTotalStrokes, kBigFive, kCCCII, kCNS1986, kCNS1992, kCangjie, kCantonese, kCheungBauer, kCheungBauerIndex, kCihaiT, kCompatibilityVariant, kCowles, kDaeJaweon, kDefinition, kEACC, kFanqie, kFenn, kFennIndex, kFourCornerCode, kGB0, kGB1, kGB3, kGB5, kGB7, kGB8, kGSR, kGradeLevel, kHDZRadBreak, kHKGlyph, kHanYu, kHangul, kHanyuPinlu, kHanyuPinyin, kIBMJapan, kIICore, kIRGDaeJaweon, kIRGHanyuDaZidian, kIRGKangXi, kIRG_GSource, kIRG_HSource, kIRG_JSource, kIRG_KPSource, kIRG_KSource, kIRG_MSource, kIRG_SSource, kIRG_TSource, kIRG_UKSource, kIRG_USource, kIRG_VSource, kJIS0213, kJa, kJapanese, kJapaneseKun, kJapaneseOn, kJinmeiyoKanji, kJis0, kJis1, kJoyoKanji, kKangXi, kKarlgren, kKorean, kKoreanEducationHanja, kKoreanName, kLau, kMainlandTelegraph, kMandarin, kMatthews, kMeyerWempe, kMojiJoho, kMorohashi, kNelson, kOtherNumeric, kPhonetic, kPrimaryNumeric, kPseudoGB1, kRSAdobe_Japan1_6, kRSUnicode, kSBGY, kSMSZD2003Index, kSMSZD2003Readings, kSemanticVariant, kSimplifiedVariant, kSpecializedSemanticVariant, kSpoofingVariant, kStrange, kTGH, kTGHZ2013, kTaiwanTelegraph, kTang, kTotalStrokes, kTraditionalVariant, kUnihanCore2020, kVietnamese, kVietnameseNumeric, kXHC1983, kXerox, kZVariant, kZhuang, kZhuangNumeric

-i, --input-files

Files inside zip to pull data from. Separated by spaces. All files used by default. Files: Unihan_DictionaryIndices.txt, Unihan_DictionaryLikeData.txt, Unihan_IRGSources.txt, Unihan_NumericValues.txt, Unihan_OtherMappings.txt, Unihan_RadicalStrokeCounts.txt, Unihan_Readings.txt, Unihan_Variants.txt

-l, --log_level

Possible choices: DEBUG, INFO, WARNING, ERROR, CRITICAL