A new package that takes user-provided text descriptions of transportation or infrastructure maps (like train networks) and returns structured feedback or improvements. It analyzes the input for key e
Project description
transitmaplint
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-corelangchain-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
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.
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 transitmaplint-2025.12.21125921.tar.gz.
File metadata
- Download URL: transitmaplint-2025.12.21125921.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c37f6924349de33dd8ad21bf7606aef1358f6f0bf52436b78571a1a08aba4dea
|
|
| MD5 |
ac77ff90fcaf95b6cadd9407b9728e3d
|
|
| BLAKE2b-256 |
ca27841f04349c065227aa7a9da77d69dc3ca2daedcd09e4c96f790edac55f75
|
File details
Details for the file transitmaplint-2025.12.21125921-py3-none-any.whl.
File metadata
- Download URL: transitmaplint-2025.12.21125921-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e76b7168f0ac4012ce159c1de92ccda749b5b05fa8242c5185803dd3888fda5a
|
|
| MD5 |
c34cf0547260af86d7b7f352e41a73d0
|
|
| BLAKE2b-256 |
9597a25266fca6c3202f918ecbf1d6da05b5de69cb1e514dd3ad2d726bfb8f4c
|