tickr-cron 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Buğra Kaya
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,260 @@
1
+ Metadata-Version: 2.4
2
+ Name: tickr-cron
3
+ Version: 1.0.0
4
+ Summary: Cron for humans - schedule tasks with natural language
5
+ Home-page: https://github.com/Bugra020/tickr
6
+ Author: Bugra020
7
+ Author-email: bugra020@gmail.com
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Operating System :: OS Independent
10
+ Requires-Python: >=3.8
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Requires-Dist: click>=8.0.0
14
+ Provides-Extra: dev
15
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
16
+ Requires-Dist: black>=23.0.0; extra == "dev"
17
+ Requires-Dist: flake8>=6.0.0; extra == "dev"
18
+ Requires-Dist: mypy>=1.0.0; extra == "dev"
19
+ Dynamic: author
20
+ Dynamic: author-email
21
+ Dynamic: classifier
22
+ Dynamic: description
23
+ Dynamic: description-content-type
24
+ Dynamic: home-page
25
+ Dynamic: license-file
26
+ Dynamic: provides-extra
27
+ Dynamic: requires-dist
28
+ Dynamic: requires-python
29
+ Dynamic: summary
30
+
31
+ [![Run Tests & Linters](https://github.com/Bugra020/scheduler-cli/actions/workflows/tests.yml/badge.svg)](https://github.com/Bugra020/scheduler-cli/actions/workflows/tests.yml)
32
+ # schedule-cli
33
+
34
+ > **Cron for humans** - tickr tasks with natural language
35
+
36
+ A simple, cross-platform task scheduler that's easier to use than cron, with human-readable syntax and built-in logging.
37
+
38
+ ## Features
39
+
40
+ - πŸ“ **Natural language scheduling** - "every 5 minutes", "every monday at 9am"
41
+ - πŸ’Ύ **Persistent storage** - tasks survive restarts
42
+ - πŸ“Š **Built-in logging** - track all executions with stdout/stderr
43
+ - πŸ”„ **Retry logic** - automatically retry failed tasks
44
+ - ⏱️ **Timeout support** - kill long-running tasks
45
+ - πŸ–₯️ **Cross-platform** - works on Linux, macOS, and Windows
46
+ - 🎯 **Simple CLI** - no complex cron syntax to remember
47
+
48
+ ## Quick Start
49
+
50
+ ### Installation
51
+
52
+ ```bash
53
+ pip install tickr
54
+ ```
55
+
56
+ Or with pipx (recommended):
57
+
58
+ ```bash
59
+ pipx install tickr
60
+ ```
61
+
62
+ ### Add Your First Task
63
+
64
+ ```bash
65
+ # Run a backup script every day at 2am
66
+ tickr add backup-db --run "python backup.py" --when "every day at 2:00"
67
+
68
+ # Check on a service every 5 minutes
69
+ tickr add health-check --run "curl https://myapp.com/health" --when "every 5 minutes"
70
+
71
+ # Send a weekly report
72
+ tickr add weekly-report --run "./send_report.sh" --when "every monday at 9:00"
73
+ ```
74
+
75
+ ### Start the Daemon
76
+
77
+ ```bash
78
+ # Start in background (Unix-like systems)
79
+ tickr daemon
80
+
81
+ # Or run in foreground (useful for debugging/Docker)
82
+ tickr daemon --foreground
83
+ ```
84
+
85
+ ### View Your Tasks
86
+
87
+ ```bash
88
+ # List all tasks
89
+ tickr list
90
+
91
+ # Detailed view
92
+ tickr list --verbose
93
+
94
+ # Check execution history
95
+ tickr logs backup-db
96
+
97
+ # Check daemon status
98
+ tickr status
99
+ ```
100
+
101
+ ## Supported tickr Formats
102
+
103
+ ### Interval-based
104
+
105
+ - `every 5 minutes` - every N minutes
106
+ - `every hour` - every N hours
107
+ - `every 3 days` - every N days
108
+
109
+ ### Time-based
110
+
111
+ - `every day at 14:30` - daily at specific time
112
+ - `every monday at 9:00` - weekly on specific day
113
+ - `every weekday at 8:00` - Monday-Friday at specific time
114
+
115
+ ### Day-based
116
+
117
+ - `every monday` - every specific weekday
118
+ - `every friday` - any day of the week
119
+ - `every weekday` - Monday through Friday
120
+
121
+ ## CLI Commands
122
+
123
+ ### `tickr add`
124
+
125
+ Add a new scheduled task.
126
+
127
+ ```bash
128
+ tickr add <task_name> --run <command> --when <schedule> [options]
129
+
130
+ Options:
131
+ --timeout SECONDS Kill task if runs longer than this
132
+ --retries N Retry N times on failure
133
+ --retry-delay SECONDS Wait between retries (default: 60)
134
+ ```
135
+
136
+ **Examples:**
137
+
138
+ ```bash
139
+ # Simple task
140
+ tickr add my-task --run "echo hello" --when "every 5 minutes"
141
+
142
+ # With timeout and retries
143
+ tickr add api-check \
144
+ --run "curl https://api.example.com" \
145
+ --when "every hour" \
146
+ --timeout 30 \
147
+ --retries 3 \
148
+ --retry-delay 120
149
+ ```
150
+
151
+ ### `tickr list`
152
+
153
+ Show all scheduled tasks.
154
+
155
+ ```bash
156
+ tickr list [--verbose]
157
+ ```
158
+
159
+ ### `tickr run`
160
+
161
+ Execute a task immediately (ignores schedule).
162
+
163
+ ```bash
164
+ tickr run <task_name>
165
+ ```
166
+
167
+ ### `tickr logs`
168
+
169
+ View execution history for a task.
170
+
171
+ ```bash
172
+ tickr logs <task_name> [--limit N] [--failed-only]
173
+
174
+ Options:
175
+ --limit N Show last N runs (default: 10)
176
+ --failed-only Only show failed executions
177
+ ```
178
+
179
+ ### `tickr enable/disable`
180
+
181
+ Enable or disable a task without deleting it.
182
+
183
+ ```bash
184
+ tickr disable <task_name>
185
+ tickr enable <task_name>
186
+ ```
187
+
188
+ ### `tickr remove`
189
+
190
+ Delete a task and all its execution history.
191
+
192
+ ```bash
193
+ tickr remove <task_name>
194
+ ```
195
+
196
+ ### `tickr daemon`
197
+
198
+ Start the tickr daemon.
199
+
200
+ ```bash
201
+ tickr daemon [--foreground]
202
+
203
+ Options:
204
+ --foreground Don't daemonize (useful for debugging/Docker)
205
+ ```
206
+
207
+ ### `tickr status`
208
+
209
+ Show daemon status and next scheduled task.
210
+
211
+ ```bash
212
+ tickr status
213
+ ```
214
+
215
+ ## Advanced Usage
216
+
217
+ ### Retry Failed Tasks
218
+
219
+ ```bash
220
+ tickr add flaky-api \
221
+ --run "python sync_data.py" \
222
+ --when "every hour" \
223
+ --retries 3 \
224
+ --retry-delay 300
225
+ ```
226
+
227
+ If the task fails, it will retry 3 times with a 5-minute delay between attempts.
228
+
229
+ ### Timeout Long-Running Tasks
230
+
231
+ ```bash
232
+ tickr add slow-task \
233
+ --run "./long_process.sh" \
234
+ --when "every day at 3am" \
235
+ --timeout 3600
236
+ ```
237
+
238
+ The task will be killed if it runs longer than 1 hour (3600 seconds).
239
+
240
+ ### Run in Docker
241
+
242
+ ```dockerfile
243
+ FROM python:3.11-slim
244
+
245
+ RUN pip install tickr
246
+
247
+ # Add your scheduled tasks
248
+ RUN tickr add my-task --run "python app.py" --when "every hour"
249
+
250
+ # Run daemon in foreground
251
+ CMD ["tickr", "daemon", "--foreground"]
252
+ ```
253
+
254
+ ## Configuration
255
+
256
+ All data is stored in `~/.tickr/`:
257
+
258
+ - `tickr.db` - SQLite database with tasks and execution history
259
+ - `daemon.pid` - PID file for the running daemon
260
+ - `daemon.log` - Daemon logs (rotated at 10MB)
@@ -0,0 +1,230 @@
1
+ [![Run Tests & Linters](https://github.com/Bugra020/scheduler-cli/actions/workflows/tests.yml/badge.svg)](https://github.com/Bugra020/scheduler-cli/actions/workflows/tests.yml)
2
+ # schedule-cli
3
+
4
+ > **Cron for humans** - tickr tasks with natural language
5
+
6
+ A simple, cross-platform task scheduler that's easier to use than cron, with human-readable syntax and built-in logging.
7
+
8
+ ## Features
9
+
10
+ - πŸ“ **Natural language scheduling** - "every 5 minutes", "every monday at 9am"
11
+ - πŸ’Ύ **Persistent storage** - tasks survive restarts
12
+ - πŸ“Š **Built-in logging** - track all executions with stdout/stderr
13
+ - πŸ”„ **Retry logic** - automatically retry failed tasks
14
+ - ⏱️ **Timeout support** - kill long-running tasks
15
+ - πŸ–₯️ **Cross-platform** - works on Linux, macOS, and Windows
16
+ - 🎯 **Simple CLI** - no complex cron syntax to remember
17
+
18
+ ## Quick Start
19
+
20
+ ### Installation
21
+
22
+ ```bash
23
+ pip install tickr
24
+ ```
25
+
26
+ Or with pipx (recommended):
27
+
28
+ ```bash
29
+ pipx install tickr
30
+ ```
31
+
32
+ ### Add Your First Task
33
+
34
+ ```bash
35
+ # Run a backup script every day at 2am
36
+ tickr add backup-db --run "python backup.py" --when "every day at 2:00"
37
+
38
+ # Check on a service every 5 minutes
39
+ tickr add health-check --run "curl https://myapp.com/health" --when "every 5 minutes"
40
+
41
+ # Send a weekly report
42
+ tickr add weekly-report --run "./send_report.sh" --when "every monday at 9:00"
43
+ ```
44
+
45
+ ### Start the Daemon
46
+
47
+ ```bash
48
+ # Start in background (Unix-like systems)
49
+ tickr daemon
50
+
51
+ # Or run in foreground (useful for debugging/Docker)
52
+ tickr daemon --foreground
53
+ ```
54
+
55
+ ### View Your Tasks
56
+
57
+ ```bash
58
+ # List all tasks
59
+ tickr list
60
+
61
+ # Detailed view
62
+ tickr list --verbose
63
+
64
+ # Check execution history
65
+ tickr logs backup-db
66
+
67
+ # Check daemon status
68
+ tickr status
69
+ ```
70
+
71
+ ## Supported tickr Formats
72
+
73
+ ### Interval-based
74
+
75
+ - `every 5 minutes` - every N minutes
76
+ - `every hour` - every N hours
77
+ - `every 3 days` - every N days
78
+
79
+ ### Time-based
80
+
81
+ - `every day at 14:30` - daily at specific time
82
+ - `every monday at 9:00` - weekly on specific day
83
+ - `every weekday at 8:00` - Monday-Friday at specific time
84
+
85
+ ### Day-based
86
+
87
+ - `every monday` - every specific weekday
88
+ - `every friday` - any day of the week
89
+ - `every weekday` - Monday through Friday
90
+
91
+ ## CLI Commands
92
+
93
+ ### `tickr add`
94
+
95
+ Add a new scheduled task.
96
+
97
+ ```bash
98
+ tickr add <task_name> --run <command> --when <schedule> [options]
99
+
100
+ Options:
101
+ --timeout SECONDS Kill task if runs longer than this
102
+ --retries N Retry N times on failure
103
+ --retry-delay SECONDS Wait between retries (default: 60)
104
+ ```
105
+
106
+ **Examples:**
107
+
108
+ ```bash
109
+ # Simple task
110
+ tickr add my-task --run "echo hello" --when "every 5 minutes"
111
+
112
+ # With timeout and retries
113
+ tickr add api-check \
114
+ --run "curl https://api.example.com" \
115
+ --when "every hour" \
116
+ --timeout 30 \
117
+ --retries 3 \
118
+ --retry-delay 120
119
+ ```
120
+
121
+ ### `tickr list`
122
+
123
+ Show all scheduled tasks.
124
+
125
+ ```bash
126
+ tickr list [--verbose]
127
+ ```
128
+
129
+ ### `tickr run`
130
+
131
+ Execute a task immediately (ignores schedule).
132
+
133
+ ```bash
134
+ tickr run <task_name>
135
+ ```
136
+
137
+ ### `tickr logs`
138
+
139
+ View execution history for a task.
140
+
141
+ ```bash
142
+ tickr logs <task_name> [--limit N] [--failed-only]
143
+
144
+ Options:
145
+ --limit N Show last N runs (default: 10)
146
+ --failed-only Only show failed executions
147
+ ```
148
+
149
+ ### `tickr enable/disable`
150
+
151
+ Enable or disable a task without deleting it.
152
+
153
+ ```bash
154
+ tickr disable <task_name>
155
+ tickr enable <task_name>
156
+ ```
157
+
158
+ ### `tickr remove`
159
+
160
+ Delete a task and all its execution history.
161
+
162
+ ```bash
163
+ tickr remove <task_name>
164
+ ```
165
+
166
+ ### `tickr daemon`
167
+
168
+ Start the tickr daemon.
169
+
170
+ ```bash
171
+ tickr daemon [--foreground]
172
+
173
+ Options:
174
+ --foreground Don't daemonize (useful for debugging/Docker)
175
+ ```
176
+
177
+ ### `tickr status`
178
+
179
+ Show daemon status and next scheduled task.
180
+
181
+ ```bash
182
+ tickr status
183
+ ```
184
+
185
+ ## Advanced Usage
186
+
187
+ ### Retry Failed Tasks
188
+
189
+ ```bash
190
+ tickr add flaky-api \
191
+ --run "python sync_data.py" \
192
+ --when "every hour" \
193
+ --retries 3 \
194
+ --retry-delay 300
195
+ ```
196
+
197
+ If the task fails, it will retry 3 times with a 5-minute delay between attempts.
198
+
199
+ ### Timeout Long-Running Tasks
200
+
201
+ ```bash
202
+ tickr add slow-task \
203
+ --run "./long_process.sh" \
204
+ --when "every day at 3am" \
205
+ --timeout 3600
206
+ ```
207
+
208
+ The task will be killed if it runs longer than 1 hour (3600 seconds).
209
+
210
+ ### Run in Docker
211
+
212
+ ```dockerfile
213
+ FROM python:3.11-slim
214
+
215
+ RUN pip install tickr
216
+
217
+ # Add your scheduled tasks
218
+ RUN tickr add my-task --run "python app.py" --when "every hour"
219
+
220
+ # Run daemon in foreground
221
+ CMD ["tickr", "daemon", "--foreground"]
222
+ ```
223
+
224
+ ## Configuration
225
+
226
+ All data is stored in `~/.tickr/`:
227
+
228
+ - `tickr.db` - SQLite database with tasks and execution history
229
+ - `daemon.pid` - PID file for the running daemon
230
+ - `daemon.log` - Daemon logs (rotated at 10MB)
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,35 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ setup(
4
+ name="tickr-cron",
5
+ version="1.0.0",
6
+ description="Cron for humans - schedule tasks with natural language",
7
+ long_description=open("README.md").read(),
8
+ long_description_content_type="text/markdown",
9
+ author="Bugra020",
10
+ author_email="bugra020@gmail.com",
11
+ url="https://github.com/Bugra020/tickr",
12
+ package_dir={"": "src"},
13
+ packages=find_packages(where="src"),
14
+ install_requires=[
15
+ "click>=8.0.0",
16
+ ],
17
+ extras_require={
18
+ "dev": [
19
+ "pytest>=7.0.0",
20
+ "black>=23.0.0",
21
+ "flake8>=6.0.0",
22
+ "mypy>=1.0.0",
23
+ ],
24
+ },
25
+ entry_points={
26
+ "console_scripts": [
27
+ "tickr=tickr.cli:cli",
28
+ ],
29
+ },
30
+ classifiers=[
31
+ "Programming Language :: Python :: 3",
32
+ "Operating System :: OS Independent",
33
+ ],
34
+ python_requires=">=3.8",
35
+ )
File without changes