Collection of Python utilities for inspecting and searching crontab.
Project description
jps-crontab-utils
Collection of Python utilities for parsing, validating, and searching crontab files.
🚀 Overview
jps-crontab-utils provides three command-line tools:
1. Crontab Parser
Parses raw crontab files into structured job objects:
- Supports per-job metadata via comment blocks
- Handles multiline commands with POSIX
\continuation - Resolves executables using
$PATHor absolute paths - Normalizes metadata keys automatically (
owner-email→owner_email)
2. Crontab Checker
Validates each cron job for:
- Required metadata (owner, owner email, reference, repository, etc.)
- Recommended metadata (labels, run frequency, description, etc.)
- Executable existence, file type, +x bit, and non-empty status
- Outputs human-readable tables or JSON for automation
3. Crontab Search Utility
Queries crontab entries based on:
- Labels (
--label nightly) - Owner email (
--email john.smith) - Code repository (
--repo git@gitlab.com:org/pipeline.git) - Full JSON output for programmatic analysis
These utilities help improve crontab hygiene, enforce team standards, and identify broken or undocumented jobs across large environments.
Features
- 🔍 Search cron jobs using metadata filters
- 📝 Parse job schedule, command, metadata
- 🛠 Validate executables and metadata completeness
- 📈 Rich terminal tables (typer + rich)
- 📦 JSON output for CI/CD and automation
- 🧪 100% test-covered parser and search modules
Example Usage
Parse and inspect a crontab
jps-crontab-parse --file /etc/crontab
Search for jobs labeled “nightly”
jps-crontab-search --file crontab.txt --label nightly
Audit a crontab
jps-crontab-check --file crontab.txt
JSON mode for pipelines
jps-crontab-check --file crontab.txt --json | jq .
📦 Installation
make install
pip install jps-crontab-utils
🧪 Development
make fix && make format && make lint
make test
📜 License
MIT License © Jaideep Sundaram
Documentation
📘 Full documentation: see docs/USAGE.md
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 jps_crontab_utils-0.1.0.tar.gz.
File metadata
- Download URL: jps_crontab_utils-0.1.0.tar.gz
- Upload date:
- Size: 14.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ddafe7c9de28449703e17cf7a293b59830a6cfdeee7e095b64849186fbacb0da
|
|
| MD5 |
4157c5991e2e7b1b2d48d5aeeabb68ea
|
|
| BLAKE2b-256 |
32f7f9daf7598505bfce53e0acac1267671ab1e02884b40f0bf143b2726d7eed
|
File details
Details for the file jps_crontab_utils-0.1.0-py3-none-any.whl.
File metadata
- Download URL: jps_crontab_utils-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a19bf53c0331f290d3047e0d4d15824e858c632173980893f9aeab9f60a7aa76
|
|
| MD5 |
0d51f9e332077e6976697d7dbe2e3351
|
|
| BLAKE2b-256 |
cc29383a2c4887c50ded770c2dc3181d7f503254974e5373fe6477fcf71194b5
|