time-travel-math-parser
Time‑Travel Math Parser transforms free‑form textual claims about paradox‑free time‑travel into a clean, structured JSON format that downstream tools can consume reliably.
Highlights
- LLM‑powered extraction using the
llmatch-messageslibrary to enforce a strict output format. - Works out‑of‑the‑box with the free tier of LLM7 thanks to a sensible default implementation (
ChatLLM7fromlangchain_llm7). - Easy to swap LLMs – you can pass any
langchaincompatibleBaseChatModel(OpenAI, Anthropic, Google, etc.) to replace the default.
Installation
pip install time-travel-math-parser
Quick Start
from time_travel_math_parser import time_travel_math_parser
user_input = """
The paper proves that any universe with a closed timelike curve will eventually resolve paradoxes by introducing a feedback loop that nullifies causal inconsistencies.
Key assumptions: (1) spacetime is differentiable, (2) causality violation is limited to the region within the wormhole throat, and (3) quantum fluctuations are suppressed.
"""
# Using the default ChatLLM7
output = time_travel_math_parser(user_input)
print(output)
output will be a list of extracted JSON objects, for example:
[
{
"claim": "any universe with a closed timelike curve will eventually resolve paradoxes ...",
"theorem_summary": "...feedback loop that nullifies causal inconsistencies",
"assumptions": [
"spacetime is differentiable",
"causality violation is limited to the region within the wormhole throat",
"quantum fluctuations are suppressed"
],
"paradox_handling": "...",
"confidence_score": 0.92
}
]
Using Your Own LLM
time_travel_math_parser accepts an optional llm argument that should be an instance of langchain BaseChatModel.
Below are examples for the three most common LLM back‑ends.
OpenAI
from langchain_openai import ChatOpenAI
from time_travel_math_parser import time_travel_math_parser
llm = ChatOpenAI() # configure API key through environment variable or kwargs
result = time_travel_math_parser(user_input, llm=llm)
Anthropic
from langchain_anthropic import ChatAnthropic
from time_travel_math_parser import time_travel_math_parser
llm = ChatAnthropic()
result = time_travel_math_parser(user_input, llm=llm)
Google Gemini
from langchain_google_genai import ChatGoogleGenerativeAI
from time_travel_math_parser import time_travel_math_parser
llm = ChatGoogleGenerativeAI()
result = time_travel_math_parser(user_input, llm=llm)
Parameters
| Parameter | Type | Description |
|---|---|---|
user_input |
str |
The free‑form text describing the time‑travel claim to parse. |
llm |
Optional[BaseChatModel] |
A LangChain chat model instance. If omitted, ChatLLM7 (free tier) is used. |
api_key |
Optional[str] |
LLM7 API key. If not supplied, the function looks for LLM7_API_KEY in the environment; if still missing it falls back to the default public key. |
Rate Limits
LLM7’s free tier provides ample throughput for most development and testing workloads.
If you require higher limits, supply a personal API key:
export LLM7_API_KEY=YOUR_KEY
or:
time_travel_math_parser(user_input, api_key="YOUR_KEY")
Free keys are available from https://token.llm7.io/.
Contributing & Issues
If you encounter bugs or have feature requests, please open an issue on GitHub: https://github.com/chigwell/time-travel-math-parser/issues
Feel free to fork and submit pull requests!
License
MIT © Eugene Evstafev – hi@eugene.plus
Author
Eugene Evstafev (chigwell)
https://github.com/chigwell
LinkedIn: https://linkedin.com/in/chigwell
Metadata
Release files for time-travel-math-parser 2025.12.20185553
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| time_travel_math_parser-2025.12.20185553.tar.gz | 5.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| time_travel_math_parser-2025.12.20185553-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.1 kB
Release files / time_travel_math_parser-2025.12.20185553.tar.gz
| Download URL | time_travel_math_parser-2025.12.20185553.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cd602aff9b0860581f4986b4d0da5982e6551751426aec3e6e88af56cdde85cf
|
|
BLAKE2b-256 checksum How to use checksums |
d3c4c30c8cbfa55dcb56a66d5e6127c7f9e4935a7f710e66db6c4499501bf1ba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.11
|
Release files / time_travel_math_parser-2025.12.20185553-py3-none-any.whl
| Download URL | time_travel_math_parser-2025.12.20185553-py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
139b2bb4abb6cfcebcacebe8d2610fdaeba47f1407d7e92912a0d5fb1980c058
|
|
BLAKE2b-256 checksum How to use checksums |
840b8df1dcfb25da3a7762de4b06ea4591b54f59b1cfef5471f5e50fc240b00b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.11
|