apiverve-cronexpressionparser 1.2.3__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
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2026 APIVerve and EvlarSoft LLC
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,383 @@
1
+ Metadata-Version: 2.4
2
+ Name: apiverve-cronexpressionparser
3
+ Version: 1.2.3
4
+ Summary: Cron Expression Parser decodes 5-field and 6-field cron expressions into human-readable schedules. Pass any cron string to verify syntax, read plain-language timing explanations, and get the next five execution timestamps.
5
+ Author-email: APIVerve <hello@apiverve.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://apiverve.com/marketplace/cronparser?utm_source=pypi&utm_medium=referral&utm_content=homepage
8
+ Project-URL: Documentation, https://docs.apiverve.com/ref/cronparser?utm_source=pypi&utm_medium=referral&utm_content=docs
9
+ Project-URL: Repository, https://github.com/apiverve/cronparser-api
10
+ Project-URL: Twitter, https://twitter.com/apivervehq
11
+ Keywords: cron,cron parser,cron validator,cron expression,schedule parser
12
+ Classifier: Development Status :: 5 - Production/Stable
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Topic :: Internet :: WWW/HTTP
17
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
18
+ Classifier: Natural Language :: English
19
+ Requires-Python: >=3.9
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: requests>=2.25.0
23
+ Dynamic: license-file
24
+
25
+ Cron Expression Parser API
26
+ ============
27
+
28
+ Cron Expression Parser decodes 5-field and 6-field cron expressions into human-readable schedules. Pass any cron string to verify syntax, read plain-language timing explanations, and get the next five execution timestamps.
29
+
30
+
31
+ [![PyPI version](https://img.shields.io/pypi/v/apiverve-cronexpressionparser.svg)](https://pypi.org/project/apiverve-cronexpressionparser/)
32
+
33
+ This is a Python wrapper for the [Cron Expression Parser API](https://apiverve.com/marketplace/cronparser?utm_source=pypi&utm_medium=referral&utm_content=readme)
34
+
35
+ ---
36
+
37
+ ## Installation
38
+
39
+ Using `pip`:
40
+
41
+ ```bash
42
+ pip install apiverve-cronexpressionparser
43
+ ```
44
+
45
+ Using `pip3`:
46
+
47
+ ```bash
48
+ pip3 install apiverve-cronexpressionparser
49
+ ```
50
+
51
+ ---
52
+
53
+ ## Configuration
54
+
55
+ Before using the Cron Expression Parser API client, you have to setup your account and obtain your API Key.
56
+ You can get it by signing up at [https://apiverve.com](https://apiverve.com?utm_source=pypi&utm_medium=referral&utm_content=readme)
57
+
58
+ ---
59
+
60
+ ## Quick Start
61
+
62
+ Here's a simple example to get you started quickly:
63
+
64
+ ```python
65
+ from apiverve_cronexpressionparser.apiClient import CronparserAPIClient
66
+
67
+ # Initialize the client with your APIVerve API key
68
+ api = CronparserAPIClient("[YOUR_API_KEY]")
69
+
70
+ query = { "expression": "0 9 * * 1-5" }
71
+
72
+ try:
73
+ # Make the API call
74
+ result = api.execute(query)
75
+
76
+ # Print the result
77
+ print(result)
78
+ except Exception as e:
79
+ print(f"Error: {e}")
80
+ ```
81
+
82
+ ---
83
+
84
+ ## Usage
85
+
86
+ The Cron Expression Parser API documentation is found here: [https://docs.apiverve.com/ref/cronparser](https://docs.apiverve.com/ref/cronparser?utm_source=pypi&utm_medium=referral&utm_content=readme).
87
+ You can find parameters, example responses, and status codes documented here.
88
+
89
+ ### Setup
90
+
91
+ ```python
92
+ # Import the client module
93
+ from apiverve_cronexpressionparser.apiClient import CronparserAPIClient
94
+
95
+ # Initialize the client with your APIVerve API key
96
+ api = CronparserAPIClient("[YOUR_API_KEY]")
97
+ ```
98
+
99
+ ---
100
+
101
+ ## Perform Request
102
+
103
+ Using the API client, you can perform requests to the API.
104
+
105
+ ###### Define Query
106
+
107
+ ```python
108
+ query = { "expression": "0 9 * * 1-5" }
109
+ ```
110
+
111
+ ###### Simple Request
112
+
113
+ ```python
114
+ # Make a request to the API
115
+ result = api.execute(query)
116
+
117
+ # Print the result
118
+ print(result)
119
+ ```
120
+
121
+ ###### Example Response
122
+
123
+ ```json
124
+ {
125
+ "status": "ok",
126
+ "error": null,
127
+ "data": {
128
+ "expression": "0 9 * * 1-5",
129
+ "isValid": true,
130
+ "format": "5-field",
131
+ "fields": {
132
+ "second": {
133
+ "expression": "0",
134
+ "description": "At 0",
135
+ "values": [
136
+ 0
137
+ ]
138
+ },
139
+ "minute": {
140
+ "expression": "0",
141
+ "description": "At 0",
142
+ "values": [
143
+ 0
144
+ ]
145
+ },
146
+ "hour": {
147
+ "expression": "9",
148
+ "description": "At 9",
149
+ "values": [
150
+ 9
151
+ ]
152
+ },
153
+ "dayOfMonth": {
154
+ "expression": "*",
155
+ "description": "Every",
156
+ "values": [
157
+ 1,
158
+ 2,
159
+ 3,
160
+ 4,
161
+ 5,
162
+ 6,
163
+ 7,
164
+ 8,
165
+ 9,
166
+ 10,
167
+ 11,
168
+ 12,
169
+ 13,
170
+ 14,
171
+ 15,
172
+ 16,
173
+ 17,
174
+ 18,
175
+ 19,
176
+ 20,
177
+ 21,
178
+ 22,
179
+ 23,
180
+ 24,
181
+ 25,
182
+ 26,
183
+ 27,
184
+ 28,
185
+ 29,
186
+ 30,
187
+ 31
188
+ ]
189
+ },
190
+ "month": {
191
+ "expression": "*",
192
+ "description": "Every",
193
+ "values": [
194
+ 1,
195
+ 2,
196
+ 3,
197
+ 4,
198
+ 5,
199
+ 6,
200
+ 7,
201
+ 8,
202
+ 9,
203
+ 10,
204
+ 11,
205
+ 12
206
+ ]
207
+ },
208
+ "dayOfWeek": {
209
+ "expression": "1-5",
210
+ "description": "From 1 to 5",
211
+ "values": [
212
+ 1,
213
+ 2,
214
+ 3,
215
+ 4,
216
+ 5
217
+ ]
218
+ }
219
+ },
220
+ "description": "At 9:00 AM on Monday, Tuesday, Wednesday, Thursday, Friday",
221
+ "frequency": {
222
+ "type": "Daily",
223
+ "interval": "day"
224
+ },
225
+ "nextRuns": [
226
+ "2026-02-19T09:00:00.000Z",
227
+ "2026-02-20T09:00:00.000Z",
228
+ "2026-02-21T09:00:00.000Z",
229
+ "2026-02-24T09:00:00.000Z",
230
+ "2026-02-25T09:00:00.000Z"
231
+ ]
232
+ }
233
+ }
234
+ ```
235
+
236
+ ---
237
+
238
+ ## Error Handling
239
+
240
+ The API client provides comprehensive error handling through the `CronparserAPIClientError` exception. Here are some examples:
241
+
242
+ ### Basic Error Handling
243
+
244
+ ```python
245
+ from apiverve_cronexpressionparser.apiClient import CronparserAPIClient, CronparserAPIClientError
246
+
247
+ api = CronparserAPIClient("[YOUR_API_KEY]")
248
+
249
+ query = { "expression": "0 9 * * 1-5" }
250
+
251
+ try:
252
+ result = api.execute(query)
253
+ print("Success!")
254
+ print(result)
255
+ except CronparserAPIClientError as e:
256
+ print(f"API Error: {e.message}")
257
+ if e.status_code:
258
+ print(f"Status Code: {e.status_code}")
259
+ if e.response:
260
+ print(f"Response: {e.response}")
261
+ ```
262
+
263
+ ### Handling Specific Error Types
264
+
265
+ ```python
266
+ from apiverve_cronexpressionparser.apiClient import CronparserAPIClient, CronparserAPIClientError
267
+
268
+ api = CronparserAPIClient("[YOUR_API_KEY]")
269
+
270
+ query = { "expression": "0 9 * * 1-5" }
271
+
272
+ try:
273
+ result = api.execute(query)
274
+
275
+ # Check for successful response
276
+ if result.get('status') == 'success':
277
+ print("Request successful!")
278
+ print(result.get('data'))
279
+ else:
280
+ print(f"API returned an error: {result.get('error')}")
281
+
282
+ except CronparserAPIClientError as e:
283
+ # Handle API client errors
284
+ if e.status_code == 401:
285
+ print("Unauthorized: Invalid API key")
286
+ elif e.status_code == 429:
287
+ print("Rate limit exceeded")
288
+ elif e.status_code >= 500:
289
+ print("Server error - please try again later")
290
+ else:
291
+ print(f"API error: {e.message}")
292
+ except Exception as e:
293
+ # Handle unexpected errors
294
+ print(f"Unexpected error: {str(e)}")
295
+ ```
296
+
297
+ ### Using Context Manager (Recommended)
298
+
299
+ The client supports the context manager protocol for automatic resource cleanup:
300
+
301
+ ```python
302
+ from apiverve_cronexpressionparser.apiClient import CronparserAPIClient, CronparserAPIClientError
303
+
304
+ query = { "expression": "0 9 * * 1-5" }
305
+
306
+ # Using context manager ensures proper cleanup
307
+ with CronparserAPIClient("[YOUR_API_KEY]") as api:
308
+ try:
309
+ result = api.execute(query)
310
+ print(result)
311
+ except CronparserAPIClientError as e:
312
+ print(f"Error: {e.message}")
313
+ # Session is automatically closed here
314
+ ```
315
+
316
+ ---
317
+
318
+ ## Advanced Features
319
+
320
+ ### Debug Mode
321
+
322
+ Enable debug logging to see detailed request and response information:
323
+
324
+ ```python
325
+ from apiverve_cronexpressionparser.apiClient import CronparserAPIClient
326
+
327
+ # Enable debug mode
328
+ api = CronparserAPIClient("[YOUR_API_KEY]", debug=True)
329
+
330
+ query = { "expression": "0 9 * * 1-5" }
331
+
332
+ # Debug information will be printed to console
333
+ result = api.execute(query)
334
+ ```
335
+
336
+ ### Manual Session Management
337
+
338
+ If you need to manually manage the session lifecycle:
339
+
340
+ ```python
341
+ from apiverve_cronexpressionparser.apiClient import CronparserAPIClient
342
+
343
+ api = CronparserAPIClient("[YOUR_API_KEY]")
344
+
345
+ query = { "expression": "0 9 * * 1-5" }
346
+
347
+ try:
348
+ result = api.execute(query)
349
+ print(result)
350
+ finally:
351
+ # Manually close the session when done
352
+ api.close()
353
+ ```
354
+
355
+ ---
356
+
357
+ ## Customer Support
358
+
359
+ Need any assistance? [Get in touch with Customer Support](https://apiverve.com/contact?utm_source=pypi&utm_medium=referral&utm_content=readme).
360
+
361
+ ---
362
+
363
+ ## Updates
364
+ Stay up to date by following [@apiverveHQ](https://twitter.com/apiverveHQ) on Twitter.
365
+
366
+ ---
367
+
368
+ ## Legal
369
+
370
+ All usage of the APIVerve website, API, and services is subject to the [APIVerve Terms of Service](https://apiverve.com/terms?utm_source=pypi&utm_medium=referral&utm_content=readme) and all legal documents and agreements.
371
+
372
+ ---
373
+
374
+ ## License
375
+ Licensed under the MIT License (MIT)
376
+
377
+ Copyright (&copy;) 2026 APIVerve, and EvlarSoft LLC
378
+
379
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
380
+
381
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
382
+
383
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.