Python SDK for Czech Intelligence Fabric (CzechFabric MCP)
Project description
🇨🇿 CzechFabric SDK
The official Python SDK for accessing the Czech Intelligence Fabric (MCP) - a unified API for Czech public services including transport, geolocation, and contextual AI tooling.
🚀 Features
- ✅ Plan public transport trips using OpenTripPlanner
- 🚏 Real-time departures from stop names or coordinates
- 🗺️ Geocode / Reverse-geocode locations
- 📍 Find nearby stops
- 📦 Fetch stop metadata and zone info
- 🧠 List available tools and generate LLM-friendly summaries
- 🔁 Built-in retry, caching, and error handling
📦 Installation
pip install czechfabric-sdk
⚡ Quick Start
from czechfabric_sdk.client import CzechFabricClient
client = CzechFabricClient(
api_key="your-api-key",
base_url="https://mcp.czechfabric.cz"
)
# Example: Plan a trip
trip = await client.plan_trip("Florenc", "Karlovo náměstí", departure_time="in 15 minutes")
print(trip)
📚 Usage Examples
Explore detailed examples in examples.md:
- 🚉 Plan a trip
- 📆 Get departures
- 🧭 Geocode / Reverse geocode
- 📍 Nearby stops
- 🧾 Stop metadata
- 📋 List stops
- 🛠️ List available tools
- 🤖 Generate prompt summary
🧰 Tool Management
You can dynamically list tools exposed by the MCP server:
tools = await client.get_tool_names()
prompt = await client.get_tool_prompt_summary()
print(prompt)
This is helpful for LLM-based assistants or debugging available capabilities.
🔐 Authentication
All requests require an API key:
client = CzechFabricClient(api_key="your-api-key", base_url="https://mcp.czechfabric.cz")
You can generate your key from your CzechFabric user dashboard.
⚠️ Error Handling
The SDK provides structured exceptions:
NetworkError– server unreachable or timed outInvalidAPIKeyError– auth failureRateLimitExceededError– too many requestsToolExecutionError– tool execution failed
🧪 Running Tests
pip install -r requirements-dev.txt
pytest tests/
📎 License
MIT © 2025 Aliyu Abdulbasit Ayinde
🌐 Project Links
- 🧠 MCP Server: https://mcp.czechfabric.cz
- 💬 Feedback & Issues: GitHub Issues
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file czechfabric_sdk-0.2.4.tar.gz.
File metadata
- Download URL: czechfabric_sdk-0.2.4.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
91c8378210dd54693a320f4ee9fdb67beff12e386e706ba475aa41e0be8a6513
|
|
| MD5 |
5075927a03a311762326eeabc18b9657
|
|
| BLAKE2b-256 |
288e0b44ee6ddc5e41f3b9ec8f0b2d429a44452fb1ebe4f2df3c31a79b03c9f6
|
File details
Details for the file czechfabric_sdk-0.2.4-py3-none-any.whl.
File metadata
- Download URL: czechfabric_sdk-0.2.4-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
91b4b9bb0a50c2126cd7b0275a8d8676ea3454c2040194688ca7743dcc94833e
|
|
| MD5 |
002ff418848dbc48f2425271feb1703a
|
|
| BLAKE2b-256 |
ba2eeb548bc57a45eaa76ce8acd891c5c015f7f7c7a3b0216160eb1a69cab90f
|