sagikoza
This is a Python library that automatically collects and obtains all public notices based on Japan's “Furikome Sagi Relief Act” You can obtain account information contained in public notices for the past three months or one year, in a registered format or standardized format.
Features
- Fetching by year or for the latest 3 months
- Parsing of collected data
- Handling data by list of dictionary
- Retry support when fetching fails
- Ensure consistent ID assignment. This can support incremental updates.
- Standardization of account names fileds and date fields (optional)
Supported Environments
- Python 3.8 or later
Installation
Install from PyPI:
python -m pip install sagikoza
Latest from GitHub:
git clone https://github.com/new-village/sagikoza
cd sagikoza
python setup.py install
Usage
Fetch notices for a specific year.
Fetching notices for the year specified in the parameter. This parameter may be available after 2008.
import sagikoza
accounts = sagikoza.fetch('2025')
print(accounts[:5])
# [{'uid': 'd06beb...', 'bank_name': 'みずほ銀行', 'name': 'グエン テイ ホアイ ニエン', 'name_alias': 'NGUYEN THI HOAI NHIEN' ...}, ...]
Fetch notices for the last 3 months
Fetching without arguments to get notices from the latest 3 months.
import sagikoza
accounts = sagikoza.fetch()
print(accounts)
# [{'uid': 'd06beb...', 'bank_name': 'みずほ銀行', 'name': 'グエン テイ ホアイ ニエン', 'name_alias': 'NGUYEN THI HOAI NHIEN' ...}, ...]
Fetch raw data
If you want to fetch raw data before normalization, set the normalize parameter to False to skip the normalization process.
import sagikoza
accounts = sagikoza.fetch('near3', normalize=False)
print(accounts)
# [{'uid': 'd06beb...', 'bank_name': 'みずほ銀行', 'name': 'NGUYEN THI HOAI NHIEN (グエン テイ ホアイ ニエン)', ...}, ...]
Save data example
I recommend you to use pandas's to_parquet, if you would like to save the data in local.
import pandas as pd
import sagikoza
accounts = sagikoza.fetch()
df = pd.DataFrame(accounts)
df.to_parquet('accounts.parquet', index=False)
Function Specification
fetch(year: str = "near3") -> list[dict]- Specify a year (YYYY) or "near3" for the latest 3 months
- Raises an exception on failure
Internal Workflow
- Fetch notice list (POST: sel_pubs.php)
- Fetch submits by Financial Institutions (POST: pubs_dispatcher.php)
- Fetch subjects (GET: pubs_basic_frame.php)
- Fetch accounts of financial crime (POST: k_pubstype_01_detail.php, etc.)
Parameters required for each step are extracted from the HTML and used for subsequent page transitions.
Logging
Uses Python's standard logging module. For detailed logs:
import logging
logging.basicConfig(level=logging.INFO, format='%(asctime)s %(levelname)s %(name)s %(message)s')
import sagikoza
sagikoza.fetch()
By default, only WARNING and above are shown. For more detail, set level=logging.DEBUG.
Notes
- This library retrieves data from public sources. Changes to the source website may affect functionality
- Accuracy and completeness of retrieved data are not guaranteed. Please use together with official information
License
Apache License 2.0
- BeautifulSoup (MIT License)
Contribution
Bug reports, feature requests, and pull requests are welcome. Please use GitHub Issues or Pull Requests.
Reference
Metadata
Release files for sagikoza 2.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| sagikoza-2.3.1.tar.gz | 31.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sagikoza-2.3.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 57.3 kB
Release files / sagikoza-2.3.1.tar.gz
| Download URL | sagikoza-2.3.1.tar.gz |
|---|---|
| Size | 31.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
86888f38632f70be320fb787fc1870d6548493fafbbd34737ff195bf764f79a2
|
|
BLAKE2b-256 checksum How to use checksums |
79157dfc97c1121b0619e49d82c2d5eb1cc55c0b9119ccf65584bc785ae18390
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.18
|
Release files / sagikoza-2.3.1-py3-none-any.whl
| Download URL | sagikoza-2.3.1-py3-none-any.whl |
|---|---|
| Size | 26.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b409ac87a45f96de37005a188d0bdad308c2d8ae59684f3044b021d88b21073d
|
|
BLAKE2b-256 checksum How to use checksums |
1f741ae68d41cab3ad1c8b27a3e64b05280b5aa1a0ca7a50839c0f82e5c9c337
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.18
|
Security for sagikoza 2.3.1
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.