Skip to main content

transitmaplint

PyPI version License: MIT Downloads LinkedIn

transitmaplint is a lightweight toolkit that takes a plain‑text description of a transportation or infrastructure map—such as a train network or bus route diagram—and returns a structured, concise critique.
The output is designed to be easy to consume programmatically or to present back to designers as quick, automated feedback.

Author: Eugene Evstafev
Email: hi@euegne.plus
GitHub: chigwell


Features

  • Route clarity assessment – Detects ambiguous terminologies and missing links in the textual map.
  • Station / stop naming – Flags inconsistent naming, duplicate names, or overly long labels.
  • Layout suggestions – Provides high‑level recommendations on how to reorder or group routes.
  • Consistent response format – The function always returns a Python list of strings, each string being one feedback item.

The package leverages the open‑source LangChain framework to query an LLM. Out‑of‑the‑box it uses ChatLLM7 from the langchain_llm7 package, but you can freely supply any LangChain chat model (OpenAI, Anthropic, Google, etc.).


Installation

pip install transitmaplint

transitmaplint pulls in its dependencies automatically:

  • langchain-core
  • langchain-llm7 (default LLM provider)
  • llmatch_messages

Quick Start

from transitmaplint import transitmaplint

# Sample map description
user_input = """
Route A: Station 1 -> Station 2 -> Station 3
Route B: Station 3 -> Station 4 -> Station 5
"""

feedback = transitmaplint(user_input)

for i, item in enumerate(feedback, 1):
    print(f"{i}. {item}")

The output will be a list of feedback strings such as:

1. Route B shares Station 3 with Route A – consider adding a buffer station.
2. Station names are concise, but "Station 1" and "Station 2" could be more descriptive.
3. The overall layout flows linearly; adding a cross‑link between Route A and Route B at Station 3 would improve connectivity.

Advanced Usage – Providing Your Own LLM

The transitmaplint function accepts an optional llm argument that can be any instance of langchain_core.language_models.BaseChatModel.
Below are examples of using popular providers.

OpenAI

from langchain_openai import ChatOpenAI
from transitmaplint import transitmaplint

llm = ChatOpenAI()  # configure as needed (API key, model, etc.)
feedback = transitmaplint(user_input, llm=llm)

Anthropic

from langchain_anthropic import ChatAnthropic
from transitmaplint import transitmaplint

llm = ChatAnthropic()
feedback = transitmaplint(user_input, llm=llm)

Google Generative AI

from langchain_google_genai import ChatGoogleGenerativeAI
from transitmaplint import transitmaplint

llm = ChatGoogleGenerativeAI()
feedback = transitmaplint(user_input, llm=llm)

Configuration – LLM7 API Key

If you want to use the default ChatLLM7 but with a higher rate limit or a personal key:

export LLM7_API_KEY="your-ultra-key-here"

or pass it directly:

feedback = transitmaplint(user_input, api_key="your-ultra-key-here")

The free tier of LLM7 is usually sufficient for most small‑to‑medium map checks.

Getting an LLM7 key – Register for free at LLM7.


Supported Return Type

List[str]

Each item in the list is a well‑structured sentence. The function guarantees that the returned data matches the regex pattern defined internally (pattern from transitmaplint.prompts). This makes it straightforward to iteratively parse or store feedback.


Development & Issues

  • Issues, feature requests, and discussion:

  • License

    MIT License – feel free to use, modify, and distribute.


    Want to contribute? Fork the repository, create a new feature branch, and open a pull request. We're happy to receive documentation, new prompt templates, or improvements to the regex checking logic.

    Metadata

    Release files for transitmaplint 2025.12.21125921

    For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

    Source distribution (sdist)

    Source distribution for transitmaplint 2025.12.21125921
    File Size Uploaded
    transitmaplint-2025.12.21125921.tar.gz 7.0 kB Details

    Built distribution (wheel)

    Table of built distributions (wheels) for transitmaplint 2025.12.21125921
    File Interpreter ABI Platform
    transitmaplint-2025.12.21125921-py3-none-any.whl Python 3 none any Details

    Total release size: 14.4 kB

    Release files / transitmaplint-2025.12.21125921.tar.gz

    Download URL transitmaplint-2025.12.21125921.tar.gz
    Size 7.0 kB
    Tags Source
    SHA-256 checksum
    How to use checksums
    c37f6924349de33dd8ad21bf7606aef1358f6f0bf52436b78571a1a08aba4dea
    BLAKE2b-256 checksum
    How to use checksums
    ca27841f04349c065227aa7a9da77d69dc3ca2daedcd09e4c96f790edac55f75
    Upload date
    Uploaded using Trusted Publishing?
    What is trusted publishing?
    No
    Uploaded via twine/6.2.0 CPython/3.12.1

    Release files / transitmaplint-2025.12.21125921-py3-none-any.whl

    Download URL transitmaplint-2025.12.21125921-py3-none-any.whl
    Size 7.4 kB
    Tags Python 3
    SHA-256 checksum
    How to use checksums
    e76b7168f0ac4012ce159c1de92ccda749b5b05fa8242c5185803dd3888fda5a
    BLAKE2b-256 checksum
    How to use checksums
    9597a25266fca6c3202f918ecbf1d6da05b5de69cb1e514dd3ad2d726bfb8f4c
    Upload date
    Uploaded using Trusted Publishing?
    What is trusted publishing?
    No
    Uploaded via twine/6.2.0 CPython/3.12.1

    Release history Release notifications | RSS feed

    This release

    2025.12.21125921 This release

    2 release files

    Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page