schedule-ng 1.3.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.
- schedule_ng-1.3.0/.gitignore +55 -0
- schedule_ng-1.3.0/HISTORY.rst +219 -0
- schedule_ng-1.3.0/LICENSE.txt +22 -0
- schedule_ng-1.3.0/PKG-INFO +111 -0
- schedule_ng-1.3.0/README.rst +82 -0
- schedule_ng-1.3.0/pyproject.toml +90 -0
- schedule_ng-1.3.0/schedule_ng/__init__.py +1001 -0
- schedule_ng-1.3.0/schedule_ng/py.typed +0 -0
- schedule_ng-1.3.0/test_schedule.py +1947 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
*.py[cod]
|
|
2
|
+
|
|
3
|
+
# C extensions
|
|
4
|
+
*.so
|
|
5
|
+
|
|
6
|
+
# Packages
|
|
7
|
+
*.egg
|
|
8
|
+
*.egg-info
|
|
9
|
+
dist
|
|
10
|
+
build
|
|
11
|
+
eggs
|
|
12
|
+
parts
|
|
13
|
+
bin
|
|
14
|
+
var
|
|
15
|
+
sdist
|
|
16
|
+
develop-eggs
|
|
17
|
+
.installed.cfg
|
|
18
|
+
lib
|
|
19
|
+
lib64
|
|
20
|
+
MANIFEST
|
|
21
|
+
|
|
22
|
+
# Installer logs
|
|
23
|
+
pip-log.txt
|
|
24
|
+
|
|
25
|
+
# Unit test / coverage reports
|
|
26
|
+
.coverage
|
|
27
|
+
.tox
|
|
28
|
+
nosetests.xml
|
|
29
|
+
|
|
30
|
+
# Translations
|
|
31
|
+
*.mo
|
|
32
|
+
|
|
33
|
+
# Mr Developer
|
|
34
|
+
.mr.developer.cfg
|
|
35
|
+
.project
|
|
36
|
+
.pydevproject
|
|
37
|
+
|
|
38
|
+
env
|
|
39
|
+
env3
|
|
40
|
+
__pycache__
|
|
41
|
+
venv
|
|
42
|
+
|
|
43
|
+
.cache
|
|
44
|
+
docs/_build
|
|
45
|
+
|
|
46
|
+
# For Idea (e.g. PyCharm) users
|
|
47
|
+
.idea
|
|
48
|
+
*.iml
|
|
49
|
+
|
|
50
|
+
# Tool caches
|
|
51
|
+
.ruff_cache/
|
|
52
|
+
.mypy_cache/
|
|
53
|
+
.pytest_cache/
|
|
54
|
+
.venv/
|
|
55
|
+
docs/_build/
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
.. :changelog:
|
|
2
|
+
|
|
3
|
+
History
|
|
4
|
+
-------
|
|
5
|
+
|
|
6
|
+
1.3.0 (2026-10-10)
|
|
7
|
+
++++++++++++++++++
|
|
8
|
+
|
|
9
|
+
First release of schedule-ng, a maintained fork of schedule 1.2.2.
|
|
10
|
+
|
|
11
|
+
- Rename the distribution to ``schedule-ng`` and the package to ``schedule_ng``.
|
|
12
|
+
The API and the ``"schedule"`` logger name are unchanged.
|
|
13
|
+
- Require Python 3.9 or newer; test on Python 3.9 to 3.14 (including free-threaded 3.14t)
|
|
14
|
+
on Linux, macOS and Windows.
|
|
15
|
+
- ``.at()`` accepts any ``tzinfo`` object for its timezone, such as
|
|
16
|
+
``zoneinfo.ZoneInfo`` or ``datetime.timezone``, not only pytz timezones.
|
|
17
|
+
Timezone names no longer require pytz: they are looked up with pytz if it is
|
|
18
|
+
installed, and with ``zoneinfo`` otherwise.
|
|
19
|
+
- Make the test suite run on Windows.
|
|
20
|
+
- Replace setup.py, setup.cfg and tox with a single pyproject.toml.
|
|
21
|
+
|
|
22
|
+
Fixes for daylight saving time (DST) changes:
|
|
23
|
+
|
|
24
|
+
- Interval jobs (seconds, minutes, hours) no longer pause for an hour when
|
|
25
|
+
clocks go back (#636, #649). These intervals now measure elapsed time, so
|
|
26
|
+
``every(4).hours`` is always 4 real hours. **Behaviour change:** schedule
|
|
27
|
+
1.2.2 used wall-clock time, so a job created at midnight on a DST day now
|
|
28
|
+
runs at 05:00 or 03:00 instead of 04:00.
|
|
29
|
+
- Jobs with a timezone (``.at("01:30", "UTC")``) no longer run an hour early
|
|
30
|
+
and then on every poll when the local clock goes back.
|
|
31
|
+
- Jobs with a timezone no longer run twice the day after their ``.at()`` time
|
|
32
|
+
fell into a DST gap.
|
|
33
|
+
- Daily and weekly jobs without a timezone now handle DST gaps like jobs with
|
|
34
|
+
a timezone: a job at 02:30 runs at 03:30 when clocks jump from 02:00 to
|
|
35
|
+
03:00. Previously it ran at 03:00.
|
|
36
|
+
- ``idle_seconds`` is correct across DST changes.
|
|
37
|
+
|
|
38
|
+
``Job.next_run`` is still a naive datetime in local time; jobs now track the
|
|
39
|
+
next run in UTC internally.
|
|
40
|
+
|
|
41
|
+
1.2.2 (2024-05-25)
|
|
42
|
+
++++++++++++++++++
|
|
43
|
+
|
|
44
|
+
- Fix bugs in cross-timezone scheduling (#601, #602, #604, #623)
|
|
45
|
+
- Add support for python 3.12 (#606)
|
|
46
|
+
- Remove dependency on old mock (#622) Thanks @a-detiste!
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
1.2.1 (2023-11-01)
|
|
50
|
+
++++++++++++++++++
|
|
51
|
+
|
|
52
|
+
- Fix bug where schedule was off when using .at with timezone (#583) Thanks @AnezeR!
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
1.2.0 (2023-04-10)
|
|
56
|
+
++++++++++++++++++
|
|
57
|
+
|
|
58
|
+
- Dropped support for Python 3.6, add support for Python 3.10 and 3.11.
|
|
59
|
+
- Add timezone support for .at(). See #517. Thanks @chrimaho!
|
|
60
|
+
- Get next run by tag (#463) Thanks @jweijers!
|
|
61
|
+
- Add py.typed file. See #521. Thanks @Akuli!
|
|
62
|
+
|
|
63
|
+
- Fix the re pattern of the 'days'. See #506 Thanks @sunpro108!
|
|
64
|
+
- Fix test_until_time failure when run early. See #563. Thanks @emollier!
|
|
65
|
+
- Fix crash repr on partially constructed job. See #569. Thanks @CPickens42!
|
|
66
|
+
- Code cleanup and modernization. See #567, #536. Thanks @masa-08 and @SergBobrovsky!
|
|
67
|
+
- Documentation improvements and fix typos. See #469, #479, #493, #519, #520. Thanks to @NaelsonDouglas, @chrimaho, @rudSarkar
|
|
68
|
+
|
|
69
|
+
1.1.0 (2021-04-09)
|
|
70
|
+
++++++++++++++++++
|
|
71
|
+
|
|
72
|
+
- Added @repeat() decorator. See #148. Thanks @rhagenaars!
|
|
73
|
+
- Added execute .until(). See #195. Thanks @fredthomsen!
|
|
74
|
+
- Added job retrieval filtered by tags using get_jobs('tag'). See #419. Thanks @skenvy!
|
|
75
|
+
- Added type annotations. See #427. Thanks @martinthoma!
|
|
76
|
+
|
|
77
|
+
- Bugfix: str() of job when there is no __name__. See #430. Thanks @biggerfisch!
|
|
78
|
+
- Improved error messages. See #280, #439. Thanks @connorskees and @sosolidkk!
|
|
79
|
+
- Improved logging. See #193. Thanks @zcking!
|
|
80
|
+
- Documentation improvements and fix typos. See #424, #435, #436, #453, #437, #448. Thanks @ebllg!
|
|
81
|
+
|
|
82
|
+
1.0.0 (2021-01-20)
|
|
83
|
+
++++++++++++++++++
|
|
84
|
+
|
|
85
|
+
Depending on your configuration, the following bugfixes might change schedule's behaviour:
|
|
86
|
+
|
|
87
|
+
- Fix: idle_seconds crashes when no jobs are scheduled. See #401. Thanks @yoonghm!
|
|
88
|
+
- Fix: day.at('HH:MM:SS') where HMS=now+10s doesn't run today. See #331. Thanks @qmorek!
|
|
89
|
+
- Fix: hour.at('MM:SS'), the seconds are set to 00. See #290. Thanks @eladbi!
|
|
90
|
+
- Fix: Long-running jobs skip a day when they finish in the next day #404. Thanks @4379711!
|
|
91
|
+
|
|
92
|
+
Other changes:
|
|
93
|
+
|
|
94
|
+
- Dropped Python 2.7 and 3.5 support, added 3.8 and 3.9 support. See #409
|
|
95
|
+
- Fix RecursionError when the job is passed to the do function as an arg. See #190. Thanks @connorskees!
|
|
96
|
+
- Fix DeprecationWarning of 'collections'. See #296. Thanks @gaguirregabiria!
|
|
97
|
+
- Replaced Travis with Github Actions for automated testing
|
|
98
|
+
- Revamp and extend documentation. See #395
|
|
99
|
+
- Improved tests. Thanks @connorskees and @Jamim!
|
|
100
|
+
- Changed log messages to DEBUG level. Thanks @aisk!
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
0.6.0 (2019-01-20)
|
|
104
|
+
++++++++++++++++++
|
|
105
|
+
|
|
106
|
+
- Make at() accept timestamps with 1 second precision (#267). Thanks @NathanWailes!
|
|
107
|
+
- Introduce proper exception hierarchy (#271). Thanks @ConnorSkees!
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
0.5.0 (2017-11-16)
|
|
111
|
+
++++++++++++++++++
|
|
112
|
+
|
|
113
|
+
- Keep partially scheduled jobs from breaking the scheduler (#125)
|
|
114
|
+
- Add support for random intervals (Thanks @grampajoe and @gilbsgilbs)
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
0.4.3 (2017-06-10)
|
|
118
|
+
++++++++++++++++++
|
|
119
|
+
|
|
120
|
+
- Improve docs & clean up docstrings
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
0.4.2 (2016-11-29)
|
|
124
|
+
++++++++++++++++++
|
|
125
|
+
|
|
126
|
+
- Publish to PyPI as a universal (py2/py3) wheel
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
0.4.0 (2016-11-28)
|
|
130
|
+
++++++++++++++++++
|
|
131
|
+
|
|
132
|
+
- Add proper HTML (Sphinx) docs available at https://schedule.readthedocs.io/
|
|
133
|
+
- CI builds now run against Python 2.7 and 3.5 (3.3 and 3.4 should work fine but are untested)
|
|
134
|
+
- Fixed an issue with ``run_all()`` and having more than one job that deletes itself in the same iteration. Thanks @alaingilbert.
|
|
135
|
+
- Add ability to tag jobs and to cancel jobs by tag. Thanks @Zerrossetto.
|
|
136
|
+
- Improve schedule docs. Thanks @Zerrossetto.
|
|
137
|
+
- Additional docs fixes by @fkromer and @yetingsky.
|
|
138
|
+
|
|
139
|
+
0.3.2 (2015-07-02)
|
|
140
|
+
++++++++++++++++++
|
|
141
|
+
|
|
142
|
+
- Fixed issues where scheduling a job with a functools.partial as the job function fails. Thanks @dylwhich.
|
|
143
|
+
- Fixed an issue where scheduling a job to run every >= 2 days would cause the initial execution to happen one day early. Thanks @WoLfulus for identifying this and providing a fix.
|
|
144
|
+
- Added a FAQ item to describe how to schedule a job that runs only once.
|
|
145
|
+
|
|
146
|
+
0.3.1 (2014-09-03)
|
|
147
|
+
++++++++++++++++++
|
|
148
|
+
|
|
149
|
+
- Fixed an issue with unicode handling in setup.py that was causing trouble on Python 3 and Debian (https://github.com/dbader/schedule/issues/27). Thanks to @waghanza for reporting it.
|
|
150
|
+
- Added an FAQ item to describe how to deal with job functions that throw exceptions. Thanks @mplewis.
|
|
151
|
+
|
|
152
|
+
0.3.0 (2014-06-14)
|
|
153
|
+
++++++++++++++++++
|
|
154
|
+
|
|
155
|
+
- Added support for scheduling jobs on specific weekdays. Example: ``schedule.every().tuesday.do(job)`` or ``schedule.every().wednesday.at("13:15").do(job)`` (Thanks @abultman.)
|
|
156
|
+
- Run tests against Python 2.7 and 3.4. Python 3.3 should continue to work but we're not actively testing it on CI anymore.
|
|
157
|
+
|
|
158
|
+
0.2.1 (2013-11-20)
|
|
159
|
+
++++++++++++++++++
|
|
160
|
+
|
|
161
|
+
- Fixed history (no code changes).
|
|
162
|
+
|
|
163
|
+
0.2.0 (2013-11-09)
|
|
164
|
+
++++++++++++++++++
|
|
165
|
+
|
|
166
|
+
- This release introduces two new features in a backwards compatible way:
|
|
167
|
+
- Allow jobs to cancel repeated execution: Jobs can be cancelled by calling ``schedule.cancel_job()`` or by returning ``schedule.CancelJob`` from the job function. (Thanks to @cfrco and @matrixise.)
|
|
168
|
+
- Updated ``at_time()`` to allow running jobs at a particular time every hour. Example: ``every().hour.at(':15').do(job)`` will run ``job`` 15 minutes after every full hour. (Thanks @mattss.)
|
|
169
|
+
- Refactored unit tests to mock ``datetime`` in a cleaner way. (Thanks @matts.)
|
|
170
|
+
|
|
171
|
+
0.1.11 (2013-07-30)
|
|
172
|
+
+++++++++++++++++++
|
|
173
|
+
|
|
174
|
+
- Fixed an issue with ``next_run()`` throwing a ``ValueError`` exception when the job queue is empty. Thanks to @dpagano for pointing this out and thanks to @mrhwick for quickly providing a fix.
|
|
175
|
+
|
|
176
|
+
0.1.10 (2013-06-07)
|
|
177
|
+
+++++++++++++++++++
|
|
178
|
+
|
|
179
|
+
- Fixed issue with ``at_time`` jobs not running on the same day the job is created (Thanks to @mattss)
|
|
180
|
+
|
|
181
|
+
0.1.9 (2013-05-27)
|
|
182
|
+
++++++++++++++++++
|
|
183
|
+
|
|
184
|
+
- Added ``schedule.next_run()``
|
|
185
|
+
- Added ``schedule.idle_seconds()``
|
|
186
|
+
- Args passed into ``do()`` are forwarded to the job function at call time
|
|
187
|
+
- Increased test coverage to 100%
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
0.1.8 (2013-05-21)
|
|
191
|
+
++++++++++++++++++
|
|
192
|
+
|
|
193
|
+
- Changed default ``delay_seconds`` for ``schedule.run_all()`` to 0 (from 60)
|
|
194
|
+
- Increased test coverage
|
|
195
|
+
|
|
196
|
+
0.1.7 (2013-05-20)
|
|
197
|
+
++++++++++++++++++
|
|
198
|
+
|
|
199
|
+
- API change: renamed ``schedule.run_all_jobs()`` to ``schedule.run_all()``
|
|
200
|
+
- API change: renamed ``schedule.run_pending_jobs()`` to ``schedule.run_pending()``
|
|
201
|
+
- API change: renamed ``schedule.clear_all_jobs()`` to ``schedule.clear()``
|
|
202
|
+
- Added ``schedule.jobs``
|
|
203
|
+
|
|
204
|
+
0.1.6 (2013-05-20)
|
|
205
|
+
++++++++++++++++++
|
|
206
|
+
|
|
207
|
+
- Fix packaging
|
|
208
|
+
- README fixes
|
|
209
|
+
|
|
210
|
+
0.1.4 (2013-05-20)
|
|
211
|
+
++++++++++++++++++
|
|
212
|
+
|
|
213
|
+
- API change: renamed ``schedule.tick()`` to ``schedule.run_pending_jobs()``
|
|
214
|
+
- Updated README and ``setup.py`` packaging
|
|
215
|
+
|
|
216
|
+
0.1.0 (2013-05-19)
|
|
217
|
+
++++++++++++++++++
|
|
218
|
+
|
|
219
|
+
- Initial release
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2013 Daniel Bader (http://dbader.org)
|
|
4
|
+
Copyright (c) 2026 schedule-ng contributors
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in
|
|
14
|
+
all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
22
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: schedule-ng
|
|
3
|
+
Version: 1.3.0
|
|
4
|
+
Summary: Job scheduling for humans. A maintained, drop-in successor to schedule.
|
|
5
|
+
Project-URL: Repository, https://github.com/Adz-ai/schedule-ng
|
|
6
|
+
Project-URL: Issues, https://github.com/Adz-ai/schedule-ng/issues
|
|
7
|
+
Project-URL: Changelog, https://github.com/Adz-ai/schedule-ng/blob/main/HISTORY.rst
|
|
8
|
+
Author-email: Daniel Bader <mail@dbader.org>
|
|
9
|
+
Maintainer: Adarssh
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE.txt
|
|
12
|
+
Keywords: clockwork,cron,job scheduling,jobs,periodic,schedule,scheduler,scheduling
|
|
13
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
24
|
+
Classifier: Typing :: Typed
|
|
25
|
+
Requires-Python: >=3.9
|
|
26
|
+
Provides-Extra: timezone
|
|
27
|
+
Requires-Dist: pytz; extra == 'timezone'
|
|
28
|
+
Description-Content-Type: text/x-rst
|
|
29
|
+
|
|
30
|
+
schedule-ng
|
|
31
|
+
===========
|
|
32
|
+
|
|
33
|
+
.. image:: https://github.com/Adz-ai/schedule-ng/actions/workflows/ci.yml/badge.svg
|
|
34
|
+
:target: https://github.com/Adz-ai/schedule-ng/actions/workflows/ci.yml
|
|
35
|
+
|
|
36
|
+
.. image:: https://img.shields.io/pypi/v/schedule-ng.svg
|
|
37
|
+
:target: https://pypi.org/project/schedule-ng/
|
|
38
|
+
|
|
39
|
+
Python job scheduling for humans. Run Python functions (or any other callable) periodically using a friendly syntax.
|
|
40
|
+
|
|
41
|
+
**schedule-ng is a maintained, drop-in compatible fork of** `schedule <https://github.com/dbader/schedule>`_
|
|
42
|
+
**by Daniel Bader**, which has not had a release since 1.2.2 (May 2024). The API is unchanged: existing code
|
|
43
|
+
keeps working by changing one import.
|
|
44
|
+
|
|
45
|
+
- A simple to use API for scheduling jobs, made for humans.
|
|
46
|
+
- In-process scheduler for periodic jobs. No extra processes needed!
|
|
47
|
+
- Very lightweight and no external dependencies.
|
|
48
|
+
- Excellent test coverage.
|
|
49
|
+
- Tested on Python 3.9 to 3.14 on Linux, macOS and Windows.
|
|
50
|
+
|
|
51
|
+
Usage
|
|
52
|
+
-----
|
|
53
|
+
|
|
54
|
+
.. code-block:: bash
|
|
55
|
+
|
|
56
|
+
$ pip install schedule-ng
|
|
57
|
+
|
|
58
|
+
.. code-block:: python
|
|
59
|
+
|
|
60
|
+
import schedule_ng as schedule
|
|
61
|
+
import time
|
|
62
|
+
|
|
63
|
+
def job():
|
|
64
|
+
print("I'm working...")
|
|
65
|
+
|
|
66
|
+
schedule.every(10).seconds.do(job)
|
|
67
|
+
schedule.every(10).minutes.do(job)
|
|
68
|
+
schedule.every().hour.do(job)
|
|
69
|
+
schedule.every().day.at("10:30").do(job)
|
|
70
|
+
schedule.every(5).to(10).minutes.do(job)
|
|
71
|
+
schedule.every().monday.do(job)
|
|
72
|
+
schedule.every().wednesday.at("13:15").do(job)
|
|
73
|
+
schedule.every().day.at("12:42", "Europe/Amsterdam").do(job)
|
|
74
|
+
schedule.every().minute.at(":17").do(job)
|
|
75
|
+
|
|
76
|
+
def job_with_argument(name):
|
|
77
|
+
print(f"I am {name}")
|
|
78
|
+
|
|
79
|
+
schedule.every(10).seconds.do(job_with_argument, name="Peter")
|
|
80
|
+
|
|
81
|
+
while True:
|
|
82
|
+
schedule.run_pending()
|
|
83
|
+
time.sleep(1)
|
|
84
|
+
|
|
85
|
+
Migrating from schedule
|
|
86
|
+
-----------------------
|
|
87
|
+
|
|
88
|
+
1. Replace ``schedule`` with ``schedule-ng`` in your dependencies.
|
|
89
|
+
2. Replace ``import schedule`` with ``import schedule_ng as schedule``.
|
|
90
|
+
|
|
91
|
+
Behaviour, exceptions and the ``"schedule"`` logger name are unchanged. Any behavioural fix is listed in the
|
|
92
|
+
`changelog <https://github.com/Adz-ai/schedule-ng/blob/main/HISTORY.rst>`_.
|
|
93
|
+
|
|
94
|
+
Why a fork?
|
|
95
|
+
-----------
|
|
96
|
+
|
|
97
|
+
``schedule`` is used by millions of projects every month, but issues and pull requests have gone unanswered
|
|
98
|
+
since 2024. This fork exists to keep it working on new Python versions, fix long-standing bugs and review the
|
|
99
|
+
community's pull requests, while keeping what made ``schedule`` popular: a small, simple, dependency-free API.
|
|
100
|
+
|
|
101
|
+
If the original project becomes active again, this fork will happily contribute its fixes back upstream.
|
|
102
|
+
|
|
103
|
+
Meta
|
|
104
|
+
----
|
|
105
|
+
|
|
106
|
+
Original author: Daniel Bader - mail@dbader.org. Thanks to Sijmen Huizenga and everyone listed in
|
|
107
|
+
`AUTHORS.rst <https://github.com/Adz-ai/schedule-ng/blob/main/AUTHORS.rst>`_ for their work on ``schedule``.
|
|
108
|
+
|
|
109
|
+
Inspired by `Adam Wiggins' <https://github.com/adamwiggins>`_ article `"Rethinking Cron" <https://adam.herokuapp.com/past/2010/4/13/rethinking_cron/>`_ and the `clockwork <https://github.com/Rykian/clockwork>`_ Ruby module.
|
|
110
|
+
|
|
111
|
+
Distributed under the MIT license. See `LICENSE.txt <https://github.com/Adz-ai/schedule-ng/blob/main/LICENSE.txt>`_ for more information.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
schedule-ng
|
|
2
|
+
===========
|
|
3
|
+
|
|
4
|
+
.. image:: https://github.com/Adz-ai/schedule-ng/actions/workflows/ci.yml/badge.svg
|
|
5
|
+
:target: https://github.com/Adz-ai/schedule-ng/actions/workflows/ci.yml
|
|
6
|
+
|
|
7
|
+
.. image:: https://img.shields.io/pypi/v/schedule-ng.svg
|
|
8
|
+
:target: https://pypi.org/project/schedule-ng/
|
|
9
|
+
|
|
10
|
+
Python job scheduling for humans. Run Python functions (or any other callable) periodically using a friendly syntax.
|
|
11
|
+
|
|
12
|
+
**schedule-ng is a maintained, drop-in compatible fork of** `schedule <https://github.com/dbader/schedule>`_
|
|
13
|
+
**by Daniel Bader**, which has not had a release since 1.2.2 (May 2024). The API is unchanged: existing code
|
|
14
|
+
keeps working by changing one import.
|
|
15
|
+
|
|
16
|
+
- A simple to use API for scheduling jobs, made for humans.
|
|
17
|
+
- In-process scheduler for periodic jobs. No extra processes needed!
|
|
18
|
+
- Very lightweight and no external dependencies.
|
|
19
|
+
- Excellent test coverage.
|
|
20
|
+
- Tested on Python 3.9 to 3.14 on Linux, macOS and Windows.
|
|
21
|
+
|
|
22
|
+
Usage
|
|
23
|
+
-----
|
|
24
|
+
|
|
25
|
+
.. code-block:: bash
|
|
26
|
+
|
|
27
|
+
$ pip install schedule-ng
|
|
28
|
+
|
|
29
|
+
.. code-block:: python
|
|
30
|
+
|
|
31
|
+
import schedule_ng as schedule
|
|
32
|
+
import time
|
|
33
|
+
|
|
34
|
+
def job():
|
|
35
|
+
print("I'm working...")
|
|
36
|
+
|
|
37
|
+
schedule.every(10).seconds.do(job)
|
|
38
|
+
schedule.every(10).minutes.do(job)
|
|
39
|
+
schedule.every().hour.do(job)
|
|
40
|
+
schedule.every().day.at("10:30").do(job)
|
|
41
|
+
schedule.every(5).to(10).minutes.do(job)
|
|
42
|
+
schedule.every().monday.do(job)
|
|
43
|
+
schedule.every().wednesday.at("13:15").do(job)
|
|
44
|
+
schedule.every().day.at("12:42", "Europe/Amsterdam").do(job)
|
|
45
|
+
schedule.every().minute.at(":17").do(job)
|
|
46
|
+
|
|
47
|
+
def job_with_argument(name):
|
|
48
|
+
print(f"I am {name}")
|
|
49
|
+
|
|
50
|
+
schedule.every(10).seconds.do(job_with_argument, name="Peter")
|
|
51
|
+
|
|
52
|
+
while True:
|
|
53
|
+
schedule.run_pending()
|
|
54
|
+
time.sleep(1)
|
|
55
|
+
|
|
56
|
+
Migrating from schedule
|
|
57
|
+
-----------------------
|
|
58
|
+
|
|
59
|
+
1. Replace ``schedule`` with ``schedule-ng`` in your dependencies.
|
|
60
|
+
2. Replace ``import schedule`` with ``import schedule_ng as schedule``.
|
|
61
|
+
|
|
62
|
+
Behaviour, exceptions and the ``"schedule"`` logger name are unchanged. Any behavioural fix is listed in the
|
|
63
|
+
`changelog <https://github.com/Adz-ai/schedule-ng/blob/main/HISTORY.rst>`_.
|
|
64
|
+
|
|
65
|
+
Why a fork?
|
|
66
|
+
-----------
|
|
67
|
+
|
|
68
|
+
``schedule`` is used by millions of projects every month, but issues and pull requests have gone unanswered
|
|
69
|
+
since 2024. This fork exists to keep it working on new Python versions, fix long-standing bugs and review the
|
|
70
|
+
community's pull requests, while keeping what made ``schedule`` popular: a small, simple, dependency-free API.
|
|
71
|
+
|
|
72
|
+
If the original project becomes active again, this fork will happily contribute its fixes back upstream.
|
|
73
|
+
|
|
74
|
+
Meta
|
|
75
|
+
----
|
|
76
|
+
|
|
77
|
+
Original author: Daniel Bader - mail@dbader.org. Thanks to Sijmen Huizenga and everyone listed in
|
|
78
|
+
`AUTHORS.rst <https://github.com/Adz-ai/schedule-ng/blob/main/AUTHORS.rst>`_ for their work on ``schedule``.
|
|
79
|
+
|
|
80
|
+
Inspired by `Adam Wiggins' <https://github.com/adamwiggins>`_ article `"Rethinking Cron" <https://adam.herokuapp.com/past/2010/4/13/rethinking_cron/>`_ and the `clockwork <https://github.com/Rykian/clockwork>`_ Ruby module.
|
|
81
|
+
|
|
82
|
+
Distributed under the MIT license. See `LICENSE.txt <https://github.com/Adz-ai/schedule-ng/blob/main/LICENSE.txt>`_ for more information.
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling >= 1.26"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "schedule-ng"
|
|
7
|
+
description = "Job scheduling for humans. A maintained, drop-in successor to schedule."
|
|
8
|
+
dynamic = ["version"]
|
|
9
|
+
readme = "README.rst"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
license-files = ["LICENSE.txt"]
|
|
12
|
+
requires-python = ">= 3.9"
|
|
13
|
+
dependencies = []
|
|
14
|
+
authors = [{ name = "Daniel Bader", email = "mail@dbader.org" }]
|
|
15
|
+
maintainers = [{ name = "Adarssh" }]
|
|
16
|
+
keywords = [
|
|
17
|
+
"schedule",
|
|
18
|
+
"periodic",
|
|
19
|
+
"jobs",
|
|
20
|
+
"scheduling",
|
|
21
|
+
"clockwork",
|
|
22
|
+
"cron",
|
|
23
|
+
"scheduler",
|
|
24
|
+
"job scheduling",
|
|
25
|
+
]
|
|
26
|
+
classifiers = [
|
|
27
|
+
"Development Status :: 5 - Production/Stable",
|
|
28
|
+
"Intended Audience :: Developers",
|
|
29
|
+
"Operating System :: OS Independent",
|
|
30
|
+
"Programming Language :: Python :: 3",
|
|
31
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
32
|
+
"Programming Language :: Python :: 3.9",
|
|
33
|
+
"Programming Language :: Python :: 3.10",
|
|
34
|
+
"Programming Language :: Python :: 3.11",
|
|
35
|
+
"Programming Language :: Python :: 3.12",
|
|
36
|
+
"Programming Language :: Python :: 3.13",
|
|
37
|
+
"Programming Language :: Python :: 3.14",
|
|
38
|
+
"Typing :: Typed",
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
[project.optional-dependencies]
|
|
42
|
+
timezone = ["pytz"]
|
|
43
|
+
|
|
44
|
+
[project.urls]
|
|
45
|
+
Repository = "https://github.com/Adz-ai/schedule-ng"
|
|
46
|
+
Issues = "https://github.com/Adz-ai/schedule-ng/issues"
|
|
47
|
+
Changelog = "https://github.com/Adz-ai/schedule-ng/blob/main/HISTORY.rst"
|
|
48
|
+
|
|
49
|
+
[dependency-groups]
|
|
50
|
+
dev = [
|
|
51
|
+
"pytest >= 8",
|
|
52
|
+
"pytest-cov",
|
|
53
|
+
"mypy",
|
|
54
|
+
"pytz",
|
|
55
|
+
"types-pytz",
|
|
56
|
+
"tzdata; sys_platform == 'win32'",
|
|
57
|
+
"ruff",
|
|
58
|
+
]
|
|
59
|
+
docs = ["sphinx"]
|
|
60
|
+
|
|
61
|
+
[tool.hatch.version]
|
|
62
|
+
path = "schedule_ng/__init__.py"
|
|
63
|
+
|
|
64
|
+
[tool.hatch.build.targets.sdist]
|
|
65
|
+
include = ["schedule_ng", "test_schedule.py", "README.rst", "HISTORY.rst", "LICENSE.txt"]
|
|
66
|
+
|
|
67
|
+
[tool.pytest.ini_options]
|
|
68
|
+
testpaths = ["test_schedule.py"]
|
|
69
|
+
addopts = "--strict-markers"
|
|
70
|
+
|
|
71
|
+
[tool.coverage.run]
|
|
72
|
+
source = ["schedule_ng"]
|
|
73
|
+
branch = true
|
|
74
|
+
|
|
75
|
+
[tool.mypy]
|
|
76
|
+
files = ["schedule_ng"]
|
|
77
|
+
|
|
78
|
+
[tool.ruff]
|
|
79
|
+
target-version = "py39"
|
|
80
|
+
extend-exclude = ["docs"]
|
|
81
|
+
|
|
82
|
+
[tool.ruff.lint]
|
|
83
|
+
# Correctness-focused rules only; style rules get adopted deliberately,
|
|
84
|
+
# not in bulk, to keep the history readable.
|
|
85
|
+
select = ["E4", "E7", "E9", "F", "B"]
|
|
86
|
+
ignore = ["B018"] # tests use bare attribute access to exercise properties
|
|
87
|
+
|
|
88
|
+
[tool.ruff.lint.per-file-ignores]
|
|
89
|
+
# Tests import pytz only to check availability, and create unused jobs on purpose.
|
|
90
|
+
"test_schedule.py" = ["F401", "F841"]
|