Skip to main content

jpcorpreg

Test PyPI - Version

jpcorpreg is a Python library that downloads corporate registry which is published in the Corporate Number Publication Site as a data frame.

Installation


jpcorpreg is available on pip installation.

$ python -m pip install jpcorpreg

GitHub Install

Installing the latest version from GitHub:

$ git clone https://github.com/new-village/jpcorpreg
$ cd jpcorpreg
$ pip install -e .

Usage

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

Starting with version 2.0.0, jpcorpreg provides a robust object-oriented client (CorporateRegistryClient) optimized for reading large datasets and native Parquet partitioning. Recent updates introduce chunked streaming capabilities that allow downloading and parsing of the entire national dataset (All prefectures) within tight memory bounds (e.g. Cloud Run deployments with less than 1GB RAM) without creating large temporary files.

Initializing the Client

First, import and initialize the client:

from jpcorpreg import CorporateRegistryClient
client = CorporateRegistryClient()

Direct Data Loading

To download data for a specific prefecture as a pandas DataFrame, use the fetch method. By passing the prefecture name in as an argument, it will perform streaming fetch from the National Tax site:

>>> df = client.fetch("Shimane")

To execute the download across all prefectures across Japan, simply leave the parameter empty or pass "All":

>>> df = client.fetch()

Differential Data Loading

If you want to download only the daily differential updates (sabun), use the fetch_diff function. By passing a date in YYYYMMDD format, you can download the diff for that specific date. If no date is provided, the latest available diff is returned.

>>> df = client.fetch_diff("20260220")

Parquet Output and Partitioning

If you prefer to save the downloaded data for data lakes explicitly, pass format="parquet". You can also supply the partition_cols argument so that the dataset is written in partitioned directories on disk. The function returns the output base directory path.

Partitioning Context Notes:

  • For fetch() (full wash dataset), use something like partition_cols=["prefecture_name"]. Avoid using "update_date" on a full data wash to prevent query fragmentation.
  • For fetch_diff() (daily diff data), use partition_cols=["update_date"] to append daily updates seamlessly into your data lake structure.
>>> # Example: Output differential data partitioned by update_date
>>> out_dir = client.fetch_diff(format="parquet", partition_cols=["update_date"])

You can then read the dynamically generated Parquet Dataset efficiently with pandas or PyArrow:

>>> import pandas as pd
>>> df = pd.read_parquet(out_dir)

Metadata

Release files for jpcorpreg 2.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jpcorpreg 2.0.2
File Size Uploaded Provenance
jpcorpreg-2.0.2.tar.gz 14.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for jpcorpreg 2.0.2
File Interpreter ABI Platform
jpcorpreg-2.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 27.6 kB

Release files / jpcorpreg-2.0.2.tar.gz

Download URL jpcorpreg-2.0.2.tar.gz
Size 14.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b865a7acff1c55c3d84251008422cdb5eafaa05481731b148f4e622f094ea0fd
BLAKE2b-256 checksum
How to use checksums
60e32d55e7c91e089365e1983b0707161091a8fcded7d05992fe049a941a432c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.19

Release files / jpcorpreg-2.0.2-py3-none-any.whl

Download URL jpcorpreg-2.0.2-py3-none-any.whl
Size 13.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2f733b9f57044e8dc26920dce5546c12b3562dc8de85a23847d801ab44c114a4
BLAKE2b-256 checksum
How to use checksums
5f43d0b7aff50a3802e177d601f9015dab6df3e61c1b6a9eb576ea1f2c1fbc44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.19

Security for jpcorpreg 2.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page