Skip to content

Custom URL parameter for "python -m unidic download"#18

Open
JackLawrenceCRISPR wants to merge 2 commits intopolm:masterfrom
JackLawrenceCRISPR:master
Open

Custom URL parameter for "python -m unidic download"#18
JackLawrenceCRISPR wants to merge 2 commits intopolm:masterfrom
JackLawrenceCRISPR:master

Conversation

@JackLawrenceCRISPR
Copy link

The following command is an example of how to use this change:

python -m unidic download "3.1.0+2021-08-31" "https://cotonoha-dic.s3-ap-northeast-1.amazonaws.com/unidic-3.1.0.zip"

I made two changes to the codebase:

  1. The unidic download command can now accept a URL argument due to a small change in the "download_version" function code. The original behavior is unaffected.
  2. The README.md documentation has been updated to explain how to specify custom "ver" and "url" parameters with an example.

You can now specify a custom URL when downloading unidic.

For example:
python -m unidic download "3.1.0+2021-08-31" "https://cotonoha-dic.s3-ap-northeast-1.amazonaws.com/unidic-3.1.0.zip"
Updated documentation to demonstrate custom ver and URL arguments in "python -m unidic download" command.

I did not mention that either ver or format can be provided directly in the ver argument.

Nor did I mention that the list of versions and formats can be found here: https://raw.githubusercontent.com/polm/unidic-py/master/dicts.json
@kneo
Copy link

kneo commented Jan 29, 2026

I second this, in addition:

If you want to use the official mirror, the script will fail because the archives use Deflate64
https://clrd.ninjal.ac.jp/unidic/en/

suggest to add, dependency:

zipfile-deflate64

and:

import zipfile_deflate64 as zipfile

instead of

import zipfile

in download.py to fix this exception.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants