Skip to main content

Python SDK for Czech Intelligence Fabric (CzechFabric MCP)

Project description

PyPI License Downloads

🇨🇿 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:


🧰 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 out
  • InvalidAPIKeyError – auth failure
  • RateLimitExceededError – too many requests
  • ToolExecutionError – tool execution failed

🧪 Running Tests

pip install -r requirements-dev.txt
pytest tests/

📎 License

MIT © 2025 Aliyu Abdulbasit Ayinde


🌐 Project Links

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

czechfabric_sdk-0.2.5.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

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

czechfabric_sdk-0.2.5-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file czechfabric_sdk-0.2.5.tar.gz.

File metadata

  • Download URL: czechfabric_sdk-0.2.5.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for czechfabric_sdk-0.2.5.tar.gz
Algorithm Hash digest
SHA256 e4bd38c81d81e50180d7422e25d53039bff82cca2d936b0c159ddbaf3d2e0b51
MD5 e1ef198840c0077f8fff6b45e7396298
BLAKE2b-256 7c1e87cb02f7e68ba089e094d1e16ea2b46a960a7fc034908172a924d9921c0d

See more details on using hashes here.

File details

Details for the file czechfabric_sdk-0.2.5-py3-none-any.whl.

File metadata

File hashes

Hashes for czechfabric_sdk-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 62584cdf75c78ecb69e8e7c178392d65429a857d076cea6fe78984a07cbdf67e
MD5 1b097b28d931126254a5716bef119b74
BLAKE2b-256 cbe8ff0425dd9309a21b9d64c6d4ad4ebe4b3bcfbf2e72d4148189a4de9ea6f1

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