shirabe-sdk (Python)
Official thin SDK for Shirabe — the Japan-specific, AI-native API platform. Zero dependencies in the core (standard library only). Python 3.8+.
The headline is composite enrich: normalize a messy customer record across four Japanese identifiers — address, personal name, corporate number, calendar date — in a single call. Ready-made LangChain / OpenAI Agents SDK tools are available as optional extras (see Agent tools).
pip install shirabe-sdk
The import name stays shirabe:
Quick start
import os
from shirabe import ShirabeClient
shirabe = ShirabeClient(api_key=os.environ.get("SHIRABE_API_KEY"))
out = shirabe.enrich({
"address": "東京都港区六本木6-10-1 森タワー",
"name": "山田太郎",
"corporate_number": "1234567890123",
"date": "2026-07-01",
})
out["results"]["address"]["status"] # "ok" | "skipped" | "unavailable" | "error"
out["results"]["name"]["split"] # {"family": "山田", "given": "太郎", ...}
out["attribution"] # aggregated CC BY 4.0 / dictionary attribution (do not strip)
fields is auto-detected from the record. Pass it explicitly to limit components:
shirabe.enrich({"name": "山田太郎", "date": "2026-07-01"}, fields=["name", "calendar"])
Access & pricing
enrich is a Hub Pro / Hub Enterprise license capability (api_key="shrb_lic_..."),
with an anonymous trial of 500 calls/month per IP for evaluation. Each component degrades
independently; if every requested component is unavailable the call raises ShirabeError with
HTTP 503 and the per-component results available on err.body.
See https://shirabe.dev/pricing for SKUs and an AI-callable quote endpoint.
Errors
Non-2xx responses raise ShirabeError with the parsed body attached:
from shirabe import ShirabeError
try:
shirabe.enrich({"address": "..."})
except ShirabeError as err:
err.code # e.g. "ENRICH_TRIAL_LIMIT_EXCEEDED"
err.status # HTTP status
err.body["error"]["license_recommend"] # hub_pro recommendation on 403/429
Other endpoints
shirabe.calendar("2026-07-01", categories=["wedding"]) # 六曜・暦注・用途別スコア
shirabe.normalize_address("東京都港区六本木6-10-1") # ABR 準拠の住所正規化
shirabe.split_name("山田太郎") # 姓名分割(IPAdic、confidence 付き)
shirabe.name_reading("東海林裕子") # 読み推定(最頻 + 収載候補の全網羅)
shirabe.validate_corporation("1234567890123") # 法人番号 検証(checksum + レジストリ実在)
shirabe.lookup_corporation("1234567890123") # 法人番号 → 商号・所在地・法人種別
shirabe.request("GET", "/api/v1/...") # low-level escape hatch
Agent tools (LangChain / OpenAI Agents SDK)
Seven ready-made tools — address normalization, name split/reading, corporate number
validate/lookup, calendar, and composite enrich — generated from a single framework-agnostic
spec (shirabe.tools). Most endpoints need no API key.
LangChain (pip install "shirabe-sdk[langchain]", langchain-core >= 0.3.40):
from shirabe.langchain import shirabe_langchain_tools
from langchain_openai import ChatOpenAI
tools = shirabe_langchain_tools()
model = ChatOpenAI(model="gpt-4o").bind_tools(tools)
Works as-is with LangGraph prebuilt agents:
from langgraph.prebuilt import create_react_agent
agent = create_react_agent(ChatOpenAI(model="gpt-4o"), shirabe_langchain_tools())
OpenAI Agents SDK (pip install "shirabe-sdk[openai-agents]", Python 3.9+):
from agents import Agent, Runner
from shirabe.openai_agents import shirabe_openai_agents_tools
agent = Agent(
name="assistant",
instructions="日本のデータは Shirabe tool で裏取りして答える。",
tools=shirabe_openai_agents_tools(),
)
result = Runner.run_sync(agent, "「東海林裕子」さんの氏名の読みを調べて。")
Both factories accept the same options as ShirabeClient
(api_key, base_url, timeout, transport, default_headers).
Custom transport
For non-standard runtimes or testing, inject a transport callable
(method, url, headers, body, timeout) -> (status, text):
ShirabeClient(transport=my_transport, base_url="https://staging.shirabe.dev")
License
MIT © Techwell Inc. Address data normalization is derived from the Digital Agency Address Base
Registry (CC BY 4.0); the attribution field returned by the API must not be stripped downstream.
Metadata
Release files for shirabe-sdk 0.2.0
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 | Actions |
|---|---|---|---|---|
| shirabe_sdk-0.2.0.tar.gz | 14.0 kB | Without provenance | Details for shirabe_sdk-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| shirabe_sdk-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for shirabe_sdk-0.2.0-py3-none-any.whl |
Total release size: 29.5 kB
Release files / shirabe_sdk-0.2.0.tar.gz
| Download URL | shirabe_sdk-0.2.0.tar.gz |
|---|---|
| Size | 14.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7e0c0aaed2a683ff2216a6447dec7c2a00b185cda26ba2156df6ac2376da63b6
|
|
BLAKE2b-256 checksum How to use checksums |
0bec2b90cd4758be07152e711163be236d1938a604a93c7e5191990c078879e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Release files / shirabe_sdk-0.2.0-py3-none-any.whl
| Download URL | shirabe_sdk-0.2.0-py3-none-any.whl |
|---|---|
| Size | 15.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
73f8407d0deec8e6c893dd23317ab869d5020dd64851153840e7743d0b436247
|
|
BLAKE2b-256 checksum How to use checksums |
4620a6239c025edfbe993ad4b2270d847a07717046284c374f13e729ed97c313
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Security for shirabe-sdk 0.2.0
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.