Skip to main content

Python client & CLI for the National Diet Library Minutes Search API (国会会議録検索システム)

Project description

jp-diet-search

PyPI Python License

Python client for the National Diet Library Kokkai Kaigiroku Kensaku System (国会会議録検索システム).

This package provides:

  • A plain-vanilla Object API for programmatic access
  • Robust error handling and safe pagination
  • No heavy dependencies or hidden magic

Features

Python Object API

  • Explicit endpoint objects:
    • client.meeting_list
    • client.meeting
    • client.speech
  • Typed query objects (MeetingListQuery, MeetingQuery, SpeechQuery)
  • Automatic pagination with optional total caps
  • Optional on-disk caching

Installation

For development:

uv sync --group dev

For normal use (after PyPI release):

pip install jp-diet-search

Development Workflow

uv sync --group dev        # Install development dependencies
uv run python -m compileall src
uv run --group dev pytest

Python API (Object API)

Basic usage

from jp_diet_search import DietClient
from jp_diet_search.queries import SpeechQuery

client = DietClient(cache_dir=".cache")

query = SpeechQuery(
    any="科学技術",
    maximum_records=100,
)

result = client.speech.search(query, limit_total=5)

print(result["numberOfRecords"])
for record in result.get("records", []):
    print(record.get("speaker"), record.get("date"))

Endpoint overview

client.meeting_list.search(MeetingListQuery(...))
client.meeting.search(MeetingQuery(...))
client.speech.search(SpeechQuery(...))

Returned values are raw JSON dictionaries aggregated across pages.


Project Structure

jp-diet-search/
  src/
    jp_diet_search/
      __init__.py
      client.py
      core.py
      endpoints.py
      queries.py
      cli.py
      exceptions.py
      models.py   # reserved (currently unused)
  tests/
  README.md
  pyproject.toml
  Makefile

Design Notes

  • The public API avoids **kwargs bags in favor of explicit query objects.
  • Internal HTTP and pagination logic lives in a dedicated core layer.
  • models.py is intentionally unused for now; responses are returned as raw JSON.
  • Console scripts are the primary execution model (no python -m required).

License

MIT License.

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

jp_diet_search-0.2.0.tar.gz (13.9 kB view details)

Uploaded Source

Built Distribution

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

jp_diet_search-0.2.0-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

Details for the file jp_diet_search-0.2.0.tar.gz.

File metadata

  • Download URL: jp_diet_search-0.2.0.tar.gz
  • Upload date:
  • Size: 13.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for jp_diet_search-0.2.0.tar.gz
Algorithm Hash digest
SHA256 eed4ee16d84d25f0b1f31347ff44c04f675575edaf51cfea4a17a9c6b18df0d3
MD5 e28b5730ee400478558332704e34280a
BLAKE2b-256 ce8d65b651b81fe685bc5a519aa87e83e712b1616d73388e9407b500a7f17a31

See more details on using hashes here.

Provenance

The following attestation bundles were made for jp_diet_search-0.2.0.tar.gz:

Publisher: pypi.yml on yeiichi/jp-diet-search

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file jp_diet_search-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: jp_diet_search-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 14.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for jp_diet_search-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 69501bbd6c21204a0e6ccc0eb08bc46ec6ff222855a007c0ac777e8824cec9b6
MD5 c7caaefb8c983409c39f16214ef618b6
BLAKE2b-256 c2a39ed6b46c51dc023400ee2521ebe9cb9e559f264a0f67ffb923018d31b366

See more details on using hashes here.

Provenance

The following attestation bundles were made for jp_diet_search-0.2.0-py3-none-any.whl:

Publisher: pypi.yml on yeiichi/jp-diet-search

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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