--- id: ctparse version: "0.3.6" license: MIT license license_treatment: permissive maintenance: abandoned --- # ctparse — Parse natural language time expressions in python License: permissive · Maintenance: abandoned · Downloads: 143.9K/mo ## What it is and what it does ctparse is a pure Python library that interprets time expressions written in natural language—phrases like "next Tuesday" or "in 3 weeks"—and converts them to structured datetime objects. It works by combining rule-based production rules with probabilistic context-free grammar (PCFG) scoring to resolve ambiguous expressions. The package assumes all expressions are relative to a reference time you provide, and by default resolves ambiguous dates into the near future unless an explicit year or past context is given. It supports English and German text and is designed for use cases like booking systems where time expressions typically refer to dates within the next few weeks. The library depends on python-dateutil, regex, and tqdm for its core functionality. It uses a corpus-based model to rank candidate resolutions, applying rules in order of likelihood rather than exhaustively trying all possibilities. However, the package is archived and no longer maintained, with the last release on 2022-11-28. Use it for: - Extract and resolve time expressions from booking or scheduling requests written in natural language - Parse German and English date phrases in customer messages or form submissions to standardize datetime values - Anchor relative time expressions like "next Friday" or "in two weeks" to a reference point for calendar applications - Detect and interpret time-of-day expressions embedded in longer text for event scheduling systems ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Parses natural language time expressions (like "May 5th 2:30 in the afternoon") into structured datetime objects, supporting English and German text relative to a reference time. Yes, if you need to parse English or German natural language time expressions and can accept that the package is no longer maintained. The low install friction and permissive license make it reasonable for existing projects, but do not adopt it for new systems where you cannot maintain a fork or where you need active bug fixes. ## Install pip install ctparse uv add ctparse poetry add ctparse ## Installing ctparse Before you install: Low install friction with only three runtime dependencies. However, the package is archived and abandoned, with the last release on 2022-11-28 and no updates since. Use only if existing functionality meets your needs and you can maintain a fork if required. License in practice: MIT license is permissive and imposes no significant restrictions on use, modification, or distribution. Quickstart: from ctparse import ctparse from datetime import datetime ts = datetime(2018, 3, 12, 14, 30) result = ctparse('May 5th 2:30 in the afternoon', ts=ts) Verify before relying: - Whether the package handles edge cases or ambiguous expressions beyond what the corpus covers - Performance characteristics when parsing large volumes of text or complex expressions - Stability of the PCFG model calibration across different input distributions ## Package facts - License: MIT license (permissive) - Python support: unspecified - Install friction: low - Maintenance: abandoned - Downloads: 143.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags natural language time parsing, parse date expressions from text, convert text to datetime, time expression recognition, english german date parsing, relative time resolution, nlp, datetime-parsing, archived [View on SkillFed](https://skillfed.io/packages/ctparse) · [View on PyPI](https://pypi.org/project/ctparse/)