--- id: click-datetime version: "0.4.0" license: MIT license_treatment: permissive maintenance: dormant --- # click-datetime — Datetime type support for click. License: permissive · Maintenance: dormant · Downloads: 75.5K/mo ## What it is and what it does Click-datetime is a small extension that teaches Click how to parse datetime values from command-line arguments. It wraps Python's datetime type as a Click parameter type, letting you define a format string and automatically convert user input into datetime objects. The package sits between Click's parameter system and Python's datetime module, handling the string-to-object conversion so your CLI code receives properly typed datetime values instead of raw strings. The package is straightforward: you instantiate a Datetime type with a format string, attach it to a Click option or argument, and the conversion happens automatically. It has no external dependencies beyond Click itself. However, the package is dormant—the last release was 704 days ago—so it receives no active maintenance. If you need datetime parsing in a Click CLI and the format is simple, this package works; if you encounter bugs or need support for complex datetime scenarios, you may need to patch it yourself or implement the conversion inline. Use it for: - Accept a date parameter in a CLI tool and receive a datetime object directly without manual string parsing. - Build a backup or log-analysis CLI that takes date ranges as command-line arguments with automatic validation. - Create a scheduling CLI where users specify dates in a consistent format and your code validates them automatically. - Develop a data-processing script that accepts date filters from the command line with format validation built in. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Adds datetime type support to Click, allowing CLI developers to parse and validate date strings as command-line parameters with custom format specifications. Yes, if you are building a Click CLI that needs datetime parameters and you are comfortable with a dormant package. The code is simple and the dependency footprint is minimal. No security vulnerabilities are known. The main trade-off is that you receive no active maintenance—if a bug appears or Click changes its internals, you will need to maintain a patch yourself or implement datetime parsing inline. For straightforward date-parameter use cases, the convenience outweighs the risk. ## Install pip install click-datetime uv add click-datetime poetry add click-datetime ## Installing click-datetime Before you install: Low friction installation with only two runtime dependencies (click and wheel). Package is dormant—last release was 704 days ago—so expect no active maintenance or bug fixes. License in practice: MIT license is permissive; you can use this package freely in commercial and open-source projects with minimal restrictions. Quickstart: pip install click-datetime from datetime import datetime import click from click_datetime import Datetime @click.command() @click.option('--date', type=Datetime(format='%Y-%m-%d')) def cli(date): click.echo(f'Date: {date}') if __name__ == '__main__': cli() Requires Python 3.12 or later (package specifies >=3.12,<4.0). Verify before relying: - Whether the package works correctly with recent versions of Click (no changelog provided to confirm compatibility). - Whether datetime parsing handles edge cases like timezone-aware datetimes or invalid format strings gracefully. - Real-world stability and bug-fix responsiveness given dormant maintenance status. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 75.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags click datetime parsing, cli date argument type, click date parameter, python click datetime option, command line date parsing, click custom type datetime, cli date string validation, cli-utilities, datetime-parsing [View on SkillFed](https://skillfed.io/packages/click-datetime) · [View on PyPI](https://pypi.org/project/click-datetime/)