Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

README + lint #1

Draft
wants to merge 1 commit into
base: dev-aps
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ kwnlp_preprocessor is a Python package to help you convert raw Wikimedia data to
# Quick Install (Requires Python >= 3.6)

```bash
pip install kwnlp-preprocessor
# Install the pre-commit setup (linters in our case)
pip install pre-commit
pre-commit install

pip install . # This package is not on pypi yet
# or "pip install -e ." to install in editable mode
```

# Status
Expand Down
21 changes: 14 additions & 7 deletions kwnlp_preprocessor/task_00_download_raw_dumps.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@
import logging
from typing import List

from kwnlp_preprocessor import argconfig
from kwnlp_preprocessor.argconfig import (
DEFAULT_KWNLP_DATA_PATH,
DEFAULT_KWNLP_WIKI_MIRROR_URL,
DEFAULT_KWNLP_WIKI,
DEFAULT_KWNLP_DOWNLOAD_JOBS,
get_argparser,
list_from_comma_delimited_string,
)
from kwnlp_dump_downloader.downloader import download_jobs


Expand All @@ -13,10 +20,10 @@
def main(
wp_yyyymmdd: str,
wd_yyyymmdd: str,
data_path: str = argconfig.DEFAULT_KWNLP_DATA_PATH,
mirror_url: str = argconfig.DEFAULT_KWNLP_WIKI_MIRROR_URL,
wiki: str = argconfig.DEFAULT_KWNLP_WIKI,
jobs_to_download: List[str] = argconfig.DEFAULT_KWNLP_DOWNLOAD_JOBS.split(","),
data_path: str = DEFAULT_KWNLP_DATA_PATH,
mirror_url: str = DEFAULT_KWNLP_WIKI_MIRROR_URL,
wiki: str = DEFAULT_KWNLP_WIKI,
jobs_to_download: List[str] = DEFAULT_KWNLP_DOWNLOAD_JOBS.split(","),
) -> None:

download_jobs(
Expand All @@ -41,12 +48,12 @@ def main(
"jobs",
"loglevel",
]
parser = argconfig.get_argparser(description, arg_names)
parser = get_argparser(description, arg_names)

args = parser.parse_args()
logging.basicConfig(level=args.loglevel)
logger.info(f"args={args}")
jobs_to_download = argconfig.list_from_comma_delimited_string(args.jobs)
jobs_to_download = list_from_comma_delimited_string(args.jobs)
logger.info(f"jobs_to_download={jobs_to_download}")

main(
Expand Down