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:

pip install -e .

For normal use (after PyPI release):

pip install jp-diet-search

Development Workflow

python -m compileall src   # Verify syntax
pip install -e .           # Install in editable mode
pytest                     # Run tests

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.1.1.tar.gz (13.0 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.1.1-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: jp_diet_search-0.1.1.tar.gz
  • Upload date:
  • Size: 13.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for jp_diet_search-0.1.1.tar.gz
Algorithm Hash digest
SHA256 73dbd87d6beaf9ffdf7f16b89d0affd4edf46f8f574e8425df18e25bce48db5c
MD5 c0524f0a9d752de554c06e820a209723
BLAKE2b-256 883996dc0315608e5e3afc58add52b32680daf5b5bbfe333b818df1e80b1fe80

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jp_diet_search-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 13.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for jp_diet_search-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9b197dda3be5665a3f29761d05adbbc3af473507a1f876963b7f44b6d4358d68
MD5 fed3913e84be9c90a4b147c06c917915
BLAKE2b-256 5f27ed96dc6714b3e87938403b815303a1dc1ebf7d9d6d77509a64829d307f51

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