Skip to main content

cnparser is a parser library of Corporate Number Publication Site data.

Project description

cnparser

Test
cnparser is a python library for loading and enrichment Corporate Number Publication Site data that is provided from National Tax Agency Japan. cnparser only support to parse latest data now.

Installation


cnparser is available on pip installation.

$ python -m pip install cnparser

GitHub Install

Installing the latest version from GitHub:

$ git clone https://github.com/new-village/cnparser
$ cd cnparser
$ python setup.py install

Usage

This section demonstrates how to use this library to load and process data from the National Tax Agency's Corporate Number Publication Site.

Direct Data Loading

To download data for a specific prefecture, use the load function. By passing the prefecture name as an argument, you can obtain a DataFrame containing data for that prefecture.If you wish to download data for a specific prefecture, you must specify the prefecture name in Roman characters (list of the supported prefectures).
To execute the load function without specifying any arguments, data for all prefectures across Japan will be downloaded.

>>> import cnparser
>>> df = cnparser.load("Shimane")

CSV Data Loading

If you already have a downloaded CSV file, use the read_csv function. By passing the file path as an argument, you can obtain a DataFrame with headers from the CSV data.

>>> import cnparser
>>> df = cnparser.read_csv("path/to/data.csv")

Data Enrichment Functionality

The enrich function adds a standardized furigana column std_furigana to the DataFrame. It processes data entry by converting name to furigana.

>>> import cnparser
>>> df = cnparser.enrich(df)

Tools

import_dict.py: Bilingual Emacspeak Project (BEP) Dictionary Import Tool

This tool imports the BEP dictionary and generates a dictionary file for use with cnparser. It processes the bilingual mappings from English to Kana, ensuring that cnparser can accurately handle and transform data involving these language elements.

$ cd /home/<USER>/analysis
$ python enrich.py <FILE_PATH>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cnparser-1.5.3.tar.gz (448.1 kB view hashes)

Uploaded Source

Built Distribution

cnparser-1.5.3-py3-none-any.whl (450.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page