cnparser is a parser library of Corporate Number Publication Site data.
Project description
cnparser
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 standardises and transforms the values of specific fields in the loaded DataFrame.
>>> import cnparser
>>> df = cnparser.enrich(df)
The functions perform all processing, but it is possible to apply only specific processing by defining specific processing as an argument.
>>> import cnparser
>>> df = cnparser.enrich(df, "enrich_kana" ...)
The processes supported by the enrich
function are as follows:
enrich_kana
: Function that adds a standardized furigana columnfurigana
to the DataFrame. It handles data entry by convertingname
to kana, iffurigana
is NaN. Note that currently only kanji and katakana conversions are supported. Alphabet conversions are not supported.enrich_kind
: Function that adds thekind
label to thelegal_entity
.enrich_post_code
: Function that adds the formatted postcode as XXX-XXX topost_code
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file cnparser-1.6.4.tar.gz
.
File metadata
- Download URL: cnparser-1.6.4.tar.gz
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 372ac90a08b6df735526a867a45522718e901e0299c6d0dcaf412a2fdc0c2751 |
|
MD5 | 4b2a2b7e6186446ebbb795adf79d2d28 |
|
BLAKE2b-256 | 1dbf57a1367161bd5257185002a6f3289469ac4c12fb4e381f4463cfc5e4e926 |
File details
Details for the file cnparser-1.6.4-py3-none-any.whl
.
File metadata
- Download URL: cnparser-1.6.4-py3-none-any.whl
- Upload date:
- Size: 14.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 891921cb679efc9067562fb10e6327c299442ea733484fd207b02b6803853cdc |
|
MD5 | 28b503eb94648acb138c9444f5084683 |
|
BLAKE2b-256 | c0e49844df3e9bd1897b45e48beec170259ec7bd64d5c9ddc2c19f745e6d3f3e |