Skip to main content

A Python library for crawling and retrieving all notices published under Japan’s Furikome Sagi Relief Act, with support for both full data extraction and incremental updates.

Project description

sagikoza

A Python library for crawling and retrieving all notices published under Japan’s Furikome Sagi Relief Act, with support for both full data extraction and incremental updates.

Features

  • Automatically retrieves public notices under the Furikome Sagi Relief Act
  • Supports fetching by year or for the most recent 3 months
  • Incremental data retrieval
  • Returns data as a list of dictionaries

Supported Python Versions

  • Python 3.8 or later

Installation

sagikoza is available on pip installation.

$ python -m pip install sagikoza

GitHub Install

Installing the latest version from GitHub:

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

Usage

This section describes how to use this library.

Get a specific year's notice

Fetch notices published under the Furikome Sagi Relief Act from 2008 onwards. Returns the notices for the year passed as an argument as 'YYYY'.

>>> import sagikoza
>>> mule_accounts = sagikoza.fetch('2025')
>>> print(mule_accounts)
[{'doc_id': '12345', 'link': '/pubs_basic_frame.php?inst_code=1234&p_id=06&pn=123456&re=0', 'id': '1234-5678-9012', 'process': '債権消滅手続開始', 'bank_name': '大江戸銀行', 'branch_name': '丸の内支店', 'branch_code': '234', 'type': '普通預金', 'account': '1234567', 'name': 'カ)エドムラサキ'}, ... ]

Get the last 3 months' notices

Fetch notices published under the Furikome Sagi Relief Act during the most recent three-month period.

>>> import sagikoza
>>> mule_accounts = sagikoza.fetch()
>>> print(mule_accounts)
[{'doc_id': '12345', 'link': '/pubs_basic_frame.php?inst_code=1234&p_id=06&pn=123456&re=0', 'id': '1234-5678-9012', 'process': '債権消滅手続開始', 'bank_name': '大江戸銀行', 'branch_name': '丸の内支店', 'branch_code': '234', 'type': '普通預金', 'account': '1234567', 'name': 'カ)エドムラサキ'}, ... ]

Logging Example

sagikoza uses Python's standard logging module. To troubleshoot or verify detailed behavior, you can configure logging as shown below to output detailed logs.

import logging
logging.basicConfig(
    level=logging.INFO,  # Change to DEBUG if more detailed logs are needed
    format='%(asctime)s %(levelname)s %(name)s %(message)s'
)
import sagikoza
sagikoza.fetch()

By default, only logs with a level of WARNING or higher are displayed. If you need detailed traces, set level=logging.DEBUG.

Contribution

Bug reports, feature requests, and pull requests are welcome. Please use GitHub Issues or Pull Requests.

License

This project is licensed under the Apache License. See the LICENSE file for details.

Notes

  • This library retrieves data from public sources. Changes to the source website may affect functionality.
  • The accuracy and completeness of the retrieved data are not guaranteed. Please use it together with official information.

Referece

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

sagikoza-1.0.1.tar.gz (16.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sagikoza-1.0.1-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file sagikoza-1.0.1.tar.gz.

File metadata

  • Download URL: sagikoza-1.0.1.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.17

File hashes

Hashes for sagikoza-1.0.1.tar.gz
Algorithm Hash digest
SHA256 2074f14221b6f236e66034bdd999ea90c8d139c7cf040d937c9db5a7766b24c6
MD5 9f0d051235434d57cacdbc419a695042
BLAKE2b-256 cf3a0469bfe267fa714382f54feaca43e074674bf7797c634972bcd36d7e3101

See more details on using hashes here.

File details

Details for the file sagikoza-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: sagikoza-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.17

File hashes

Hashes for sagikoza-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 42955cebdba549ebfde7d85a85ff33d7f1ff66e67101276211e7bf04a518a77c
MD5 ead58343babff27c4d2d139adddcd3a3
BLAKE2b-256 832d6df4f230338c0df219fba592fb8a1ec4290e99e0328815d19a8b3d858ed9

See more details on using hashes here.

Supported by

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