postbridge-core
Shared tool catalog, HTTP dispatcher, and Pydantic schema generator for PostBridge. Depended on by the framework-specific wrappers — you usually won't install this directly.
Install
pip install postbridge-core
Already installed as a dependency if you picked up postbridge-crewai, postbridge-langchain, or postbridge-llamaindex.
What's inside
| Module | Purpose |
|---|---|
tools.json |
Canonical 8-tool catalog — the single source of truth |
loader.py |
Load, filter, lookup catalog entries |
dispatcher.py |
execute(tool_name, args) → live HTTP call to api.postbridge.ai |
pydantic_gen.py |
JSON Schema → Pydantic model generator |
Public API
from postbridge_core import (
get_tools_raw, # list[dict] — raw catalog entries
get_tool, # dict — single entry by name
api_base_url, # str — https://api.postbridge.ai
execute, # callable — run a tool against the live API
build_args_model, # callable — JSON Schema → Pydantic model
load_catalog, # dict — full catalog
)
Dispatching a tool call
from postbridge_core import execute
import os
os.environ["POSTBRIDGE_API_KEY"] = "pb_live_..."
# Path-param tool
status = execute("track_letter", {"letter_id": "abc-123"})
# Body-only tool
quote = execute("quote_letter", {
"to_name": "Marie Dupont",
"to_line1": "15 Rue de Rivoli",
"to_city": "Paris",
"to_postal_code": "75001",
"to_country": "FR",
"service": "fr_lettre_verte",
})
Building a Pydantic model for a tool
from postbridge_core import get_tool, build_args_model
send = get_tool("send_letter")
SendLetterArgs = build_args_model("send_letter", send["parameters"])
# SendLetterArgs is a full Pydantic v2 BaseModel:
args = SendLetterArgs(to_name="...", ...)
For users of the framework wrappers
You probably don't need this package directly. See instead:
postbridge-crewai— CrewAI toolspostbridge-langchain— LangChain and LangGraph toolspostbridge-llamaindex— LlamaIndex tools
Each of those uses postbridge-core under the hood — same catalog, same dispatcher, same validation.
Tool catalog (as of v0.1.0)
| Tool | Method | Path |
|---|---|---|
list_services |
GET | /api/services/{country} |
quote_letter |
POST | /api/quote |
send_letter |
POST | /api/send |
track_letter |
GET | /api/track/{letter_id} |
get_proof |
GET | /api/proof/{letter_id} |
get_balance |
GET | /api/balance |
negotiate_pricing |
POST | /api/anp/offer |
accept_offer |
POST | /api/anp/accept |
Full developer reference: postbridge.ai/developers.html.
Metadata
Release files for postbridge-core 0.1.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 | |
|---|---|---|---|
| postbridge_core-0.1.0.tar.gz | 9.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| postbridge_core-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.1 kB
Release files / postbridge_core-0.1.0.tar.gz
| Download URL | postbridge_core-0.1.0.tar.gz |
|---|---|
| Size | 9.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eea3ce86cbd2176d8250b98c0d0d270d6430c3398c8e0ffd86abfff6939162f4
|
|
BLAKE2b-256 checksum How to use checksums |
d5bfda785d82b588c3b10091e827b87aa3aa6b9745cb96721f49c87055252b99
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.9
|
Release files / postbridge_core-0.1.0-py3-none-any.whl
| Download URL | postbridge_core-0.1.0-py3-none-any.whl |
|---|---|
| Size | 9.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5f4e278210785184143d5a691a0099638b3097dd0c724786153734def76d68d9
|
|
BLAKE2b-256 checksum How to use checksums |
5499995e6cf635a34a34a245975f365613a4dd19ac506795fc4210fb3ad07e70
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.9
|