From 21f43a272488735c55e2447352ab6883d2976df4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Gr=C3=B6nholm?= Date: Mon, 1 Aug 2022 02:23:14 +0300 Subject: Replaced the API documentation --- docs/api.rst | 111 ++++++++++++++++++++++++++++ docs/index.rst | 2 +- docs/modules/events.rst | 90 ----------------------- docs/modules/executors/asyncio.rst | 10 --- docs/modules/executors/base.rst | 10 --- docs/modules/executors/debug.rst | 10 --- docs/modules/executors/gevent.rst | 10 --- docs/modules/executors/pool.rst | 13 ---- docs/modules/executors/twisted.rst | 10 --- docs/modules/job.rst | 10 --- docs/modules/jobstores/base.rst | 10 --- docs/modules/jobstores/memory.rst | 29 -------- docs/modules/jobstores/mongodb.rst | 25 ------- docs/modules/jobstores/redis.rst | 25 ------- docs/modules/jobstores/rethinkdb.rst | 25 ------- docs/modules/jobstores/sqlalchemy.rst | 28 ------- docs/modules/jobstores/zookeeper.rst | 25 ------- docs/modules/schedulers.rst | 5 -- docs/modules/schedulers/asyncio.rst | 32 -------- docs/modules/schedulers/background.rst | 29 -------- docs/modules/schedulers/base.rst | 6 -- docs/modules/schedulers/blocking.rst | 30 -------- docs/modules/schedulers/gevent.rst | 28 ------- docs/modules/schedulers/tornado.rst | 27 ------- docs/modules/schedulers/twisted.rst | 28 ------- docs/modules/triggers/base.rst | 10 --- docs/modules/triggers/calendarinterval.rst | 64 ---------------- docs/modules/triggers/combining.rst | 35 --------- docs/modules/triggers/cron.rst | 113 ----------------------------- docs/modules/triggers/date.rst | 59 --------------- docs/modules/triggers/interval.rst | 61 ---------------- docs/py-modindex.rst | 2 - 32 files changed, 112 insertions(+), 860 deletions(-) create mode 100644 docs/api.rst delete mode 100644 docs/modules/events.rst delete mode 100644 docs/modules/executors/asyncio.rst delete mode 100644 docs/modules/executors/base.rst delete mode 100644 docs/modules/executors/debug.rst delete mode 100644 docs/modules/executors/gevent.rst delete mode 100644 docs/modules/executors/pool.rst delete mode 100644 docs/modules/executors/twisted.rst delete mode 100644 docs/modules/job.rst delete mode 100644 docs/modules/jobstores/base.rst delete mode 100644 docs/modules/jobstores/memory.rst delete mode 100644 docs/modules/jobstores/mongodb.rst delete mode 100644 docs/modules/jobstores/redis.rst delete mode 100644 docs/modules/jobstores/rethinkdb.rst delete mode 100644 docs/modules/jobstores/sqlalchemy.rst delete mode 100644 docs/modules/jobstores/zookeeper.rst delete mode 100644 docs/modules/schedulers.rst delete mode 100644 docs/modules/schedulers/asyncio.rst delete mode 100644 docs/modules/schedulers/background.rst delete mode 100644 docs/modules/schedulers/base.rst delete mode 100644 docs/modules/schedulers/blocking.rst delete mode 100644 docs/modules/schedulers/gevent.rst delete mode 100644 docs/modules/schedulers/tornado.rst delete mode 100644 docs/modules/schedulers/twisted.rst delete mode 100644 docs/modules/triggers/base.rst delete mode 100644 docs/modules/triggers/calendarinterval.rst delete mode 100644 docs/modules/triggers/combining.rst delete mode 100644 docs/modules/triggers/cron.rst delete mode 100644 docs/modules/triggers/date.rst delete mode 100644 docs/modules/triggers/interval.rst delete mode 100644 docs/py-modindex.rst diff --git a/docs/api.rst b/docs/api.rst new file mode 100644 index 0000000..de2758f --- /dev/null +++ b/docs/api.rst @@ -0,0 +1,111 @@ +API reference +============= + +Data structures +--------------- + +.. autoclass:: apscheduler.Task +.. autoclass:: apscheduler.Schedule +.. autoclass:: apscheduler.Job +.. autoclass:: apscheduler.JobInfo +.. autoclass:: apscheduler.JobResult +.. autoclass:: apscheduler.RetrySettings + +Schedulers +---------- + +.. autoclass:: apscheduler.schedulers.sync.Scheduler +.. autoclass:: apscheduler.schedulers.async_.AsyncScheduler + +Workers +------- + +.. autoclass:: apscheduler.workers.sync.Worker +.. autoclass:: apscheduler.workers.async_.AsyncWorker + +Data stores +----------- + +.. autoclass:: apscheduler.datastores.memory.MemoryDataStore +.. autoclass:: apscheduler.datastores.sqlalchemy.SQLAlchemyDataStore +.. autoclass:: apscheduler.datastores.async_sqlalchemy.AsyncSQLAlchemyDataStore +.. autoclass:: apscheduler.datastores.mongodb.MongoDBDataStore + +Event brokers +------------- + +.. autoclass:: apscheduler.eventbrokers.local.LocalEventBroker +.. autoclass:: apscheduler.eventbrokers.async_local.LocalAsyncEventBroker +.. autoclass:: apscheduler.eventbrokers.asyncpg.AsyncpgEventBroker +.. autoclass:: apscheduler.eventbrokers.mqtt.MQTTEventBroker +.. autoclass:: apscheduler.eventbrokers.redis.RedisEventBroker + +Serializers +----------- + +.. autoclass:: apscheduler.serializers.cbor.CBORSerializer +.. autoclass:: apscheduler.serializers.json.JSONSerializer +.. autoclass:: apscheduler.serializers.pickle.PickleSerializer + +Triggers +-------- + +.. autoclass:: apscheduler.triggers.date.DateTrigger +.. autoclass:: apscheduler.triggers.interval.IntervalTrigger +.. autoclass:: apscheduler.triggers.calendarinterval.CalendarIntervalTrigger +.. autoclass:: apscheduler.triggers.combining.AndTrigger +.. autoclass:: apscheduler.triggers.combining.OrTrigger +.. autoclass:: apscheduler.triggers.cron.CronTrigger + +Events +------ + +.. autoclass:: apscheduler.Event +.. autoclass:: apscheduler.DataStoreEvent +.. autoclass:: apscheduler.TaskAdded +.. autoclass:: apscheduler.TaskUpdated +.. autoclass:: apscheduler.TaskRemoved +.. autoclass:: apscheduler.ScheduleAdded +.. autoclass:: apscheduler.ScheduleUpdated +.. autoclass:: apscheduler.ScheduleRemoved +.. autoclass:: apscheduler.JobAdded +.. autoclass:: apscheduler.JobRemoved +.. autoclass:: apscheduler.ScheduleDeserializationFailed +.. autoclass:: apscheduler.JobDeserializationFailed +.. autoclass:: apscheduler.SchedulerEvent +.. autoclass:: apscheduler.SchedulerStarted +.. autoclass:: apscheduler.SchedulerStopped +.. autoclass:: apscheduler.WorkerEvent +.. autoclass:: apscheduler.WorkerStarted +.. autoclass:: apscheduler.WorkerStopped +.. autoclass:: apscheduler.JobAcquired +.. autoclass:: apscheduler.JobReleased + +Enumerated types +---------------- + +.. autoclass:: apscheduler.RunState +.. autoclass:: apscheduler.JobOutcome +.. autoclass:: apscheduler.ConflictPolicy +.. autoclass:: apscheduler.CoalescePolicy + +Context variables +----------------- + +.. autodata:: apscheduler.current_scheduler +.. autodata:: apscheduler.current_worker +.. autodata:: apscheduler.job_info + +Exceptions +---------- + +.. autoexception:: apscheduler.TaskLookupError +.. autoexception:: apscheduler.ScheduleLookupError +.. autoexception:: apscheduler.JobLookupError +.. autoexception:: apscheduler.JobResultNotReady +.. autoexception:: apscheduler.JobCancelled +.. autoexception:: apscheduler.JobDeadlineMissed +.. autoexception:: apscheduler.ConflictingIdError +.. autoexception:: apscheduler.SerializationError +.. autoexception:: apscheduler.DeserializationError +.. autoexception:: apscheduler.MaxIterationsReached diff --git a/docs/index.rst b/docs/index.rst index 9783bbc..4e843ee 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -18,4 +18,4 @@ Table of Contents contributing extending faq - py-modindex + api diff --git a/docs/modules/events.rst b/docs/modules/events.rst deleted file mode 100644 index 54dd85b..0000000 --- a/docs/modules/events.rst +++ /dev/null @@ -1,90 +0,0 @@ -:mod:`apscheduler.events` -============================ - -.. automodule:: apscheduler.events - -API ---- - -.. autoclass:: SchedulerEvent - :members: - -.. autoclass:: JobEvent - :members: - :show-inheritance: - -.. autoclass:: JobSubmissionEvent - :members: - :show-inheritance: - -.. autoclass:: JobExecutionEvent - :members: - :show-inheritance: - - -Event codes ------------ - -The following event codes are numeric constants importable from :mod:`apscheduler.events`. - -.. list-table:: - :header-rows: 1 - - * - Constant - - Description - - Event class - * - EVENT_SCHEDULER_STARTED - - The scheduler was started - - :class:`SchedulerEvent` - * - EVENT_SCHEDULER_SHUTDOWN - - The scheduler was shut down - - :class:`SchedulerEvent` - * - EVENT_SCHEDULER_PAUSED - - Job processing in the scheduler was paused - - :class:`SchedulerEvent` - * - EVENT_SCHEDULER_RESUMED - - Job processing in the scheduler was resumed - - :class:`SchedulerEvent` - * - EVENT_EXECUTOR_ADDED - - An executor was added to the scheduler - - :class:`SchedulerEvent` - * - EVENT_EXECUTOR_REMOVED - - An executor was removed to the scheduler - - :class:`SchedulerEvent` - * - EVENT_JOBSTORE_ADDED - - A job store was added to the scheduler - - :class:`SchedulerEvent` - * - EVENT_JOBSTORE_REMOVED - - A job store was removed from the scheduler - - :class:`SchedulerEvent` - * - EVENT_ALL_JOBS_REMOVED - - All jobs were removed from either all job stores or one particular job store - - :class:`SchedulerEvent` - * - EVENT_JOB_ADDED - - A job was added to a job store - - :class:`JobEvent` - * - EVENT_JOB_REMOVED - - A job was removed from a job store - - :class:`JobEvent` - * - EVENT_JOB_MODIFIED - - A job was modified from outside the scheduler - - :class:`JobEvent` - * - EVENT_JOB_SUBMITTED - - A job was submitted to its executor to be run - - :class:`JobSubmissionEvent` - * - EVENT_JOB_MAX_INSTANCES - - A job being submitted to its executor was not accepted by the executor because the job has - already reached its maximum concurrently executing instances - - :class:`JobSubmissionEvent` - * - EVENT_JOB_EXECUTED - - A job was executed successfully - - :class:`JobExecutionEvent` - * - EVENT_JOB_ERROR - - A job raised an exception during execution - - :class:`JobExecutionEvent` - * - EVENT_JOB_MISSED - - A job's execution was missed - - :class:`JobExecutionEvent` - * - EVENT_ALL - - A catch-all mask that includes every event type - - N/A diff --git a/docs/modules/executors/asyncio.rst b/docs/modules/executors/asyncio.rst deleted file mode 100644 index 9ad09c4..0000000 --- a/docs/modules/executors/asyncio.rst +++ /dev/null @@ -1,10 +0,0 @@ -:mod:`apscheduler.executors.asyncio` -==================================== - -.. automodule:: apscheduler.executors.asyncio - -Module Contents ---------------- - -.. autoclass:: AsyncIOExecutor - :members: diff --git a/docs/modules/executors/base.rst b/docs/modules/executors/base.rst deleted file mode 100644 index 255d7e6..0000000 --- a/docs/modules/executors/base.rst +++ /dev/null @@ -1,10 +0,0 @@ -:mod:`apscheduler.executors.base` -================================= - -.. automodule:: apscheduler.executors.base - -Module Contents ---------------- - -.. autoclass:: BaseExecutor - :members: diff --git a/docs/modules/executors/debug.rst b/docs/modules/executors/debug.rst deleted file mode 100644 index eadc94c..0000000 --- a/docs/modules/executors/debug.rst +++ /dev/null @@ -1,10 +0,0 @@ -:mod:`apscheduler.executors.debug` -================================== - -.. automodule:: apscheduler.executors.debug - -Module Contents ---------------- - -.. autoclass:: DebugExecutor - :members: diff --git a/docs/modules/executors/gevent.rst b/docs/modules/executors/gevent.rst deleted file mode 100644 index 8546361..0000000 --- a/docs/modules/executors/gevent.rst +++ /dev/null @@ -1,10 +0,0 @@ -:mod:`apscheduler.executors.gevent` -=================================== - -.. automodule:: apscheduler.executors.gevent - -Module Contents ---------------- - -.. autoclass:: GeventExecutor - :members: diff --git a/docs/modules/executors/pool.rst b/docs/modules/executors/pool.rst deleted file mode 100644 index e1397cf..0000000 --- a/docs/modules/executors/pool.rst +++ /dev/null @@ -1,13 +0,0 @@ -:mod:`apscheduler.executors.pool` -================================= - -.. automodule:: apscheduler.executors.pool - -Module Contents ---------------- - -.. autoclass:: ThreadPoolExecutor - :members: - -.. autoclass:: ProcessPoolExecutor - :members: diff --git a/docs/modules/executors/twisted.rst b/docs/modules/executors/twisted.rst deleted file mode 100644 index 60664ee..0000000 --- a/docs/modules/executors/twisted.rst +++ /dev/null @@ -1,10 +0,0 @@ -:mod:`apscheduler.executors.twisted` -==================================== - -.. automodule:: apscheduler.executors.twisted - -Module Contents ---------------- - -.. autoclass:: TwistedExecutor - :members: diff --git a/docs/modules/job.rst b/docs/modules/job.rst deleted file mode 100644 index aa56cb6..0000000 --- a/docs/modules/job.rst +++ /dev/null @@ -1,10 +0,0 @@ -:mod:`apscheduler.job` -====================== - -.. automodule:: apscheduler.job - -API ---- - -.. autoclass:: Job - :members: diff --git a/docs/modules/jobstores/base.rst b/docs/modules/jobstores/base.rst deleted file mode 100644 index 1402b5a..0000000 --- a/docs/modules/jobstores/base.rst +++ /dev/null @@ -1,10 +0,0 @@ -:mod:`apscheduler.jobstores.base` -================================= - -.. automodule:: apscheduler.jobstores.base - -API ---- - -.. autoclass:: BaseJobStore - :members: diff --git a/docs/modules/jobstores/memory.rst b/docs/modules/jobstores/memory.rst deleted file mode 100644 index c91935c..0000000 --- a/docs/modules/jobstores/memory.rst +++ /dev/null @@ -1,29 +0,0 @@ -:mod:`apscheduler.jobstores.memory` -=================================== - -.. automodule:: apscheduler.jobstores.memory - -API ---- - -.. autoclass:: MemoryJobStore - :show-inheritance: - - -Introduction ------------- - -MemoryJobStore stores jobs in memory as-is, without serializing them. This allows you to schedule callables that are -unreachable globally and use job non-serializable job arguments. - -.. list-table:: - :widths: 1 4 - - * - External dependencies - - none - * - Example - - ``examples/schedulers/blocking.py`` - (`view online `_). - -.. caution:: Unlike with other job stores, changes made to any mutable job arguments persist across job invocations. - You can use this to your advantage, however. diff --git a/docs/modules/jobstores/mongodb.rst b/docs/modules/jobstores/mongodb.rst deleted file mode 100644 index ffc1375..0000000 --- a/docs/modules/jobstores/mongodb.rst +++ /dev/null @@ -1,25 +0,0 @@ -:mod:`apscheduler.jobstores.mongodb` -==================================== - -.. automodule:: apscheduler.jobstores.mongodb - -API ---- - -.. autoclass:: MongoDBJobStore(database='apscheduler', collection='jobs', client=None, pickle_protocol=pickle.HIGHEST_PROTOCOL, **connect_args) - :show-inheritance: - - -Introduction ------------- - -MongoDBJobStore stores jobs in a `MongoDB `_ database. - -.. list-table:: - :widths: 1 4 - - * - External dependencies - - `pymongo `_ - * - Example - - ``examples/jobstores/mongodb.py`` - (`view online `_). diff --git a/docs/modules/jobstores/redis.rst b/docs/modules/jobstores/redis.rst deleted file mode 100644 index 8d7f833..0000000 --- a/docs/modules/jobstores/redis.rst +++ /dev/null @@ -1,25 +0,0 @@ -:mod:`apscheduler.jobstores.redis` -================================== - -.. automodule:: apscheduler.jobstores.redis - -API ---- - -.. autoclass:: RedisJobStore(db=0, jobs_key='apscheduler.jobs', run_times_key='apscheduler.run_times', pickle_protocol=pickle.HIGHEST_PROTOCOL, **connect_args) - :show-inheritance: - - -Introduction ------------- - -RedisJobStore stores jobs in a `redis `_ database. - -.. list-table:: - :widths: 1 4 - - * - External dependencies - - `redis `_ - * - Example - - ``examples/jobstores/redis_.py`` - (`view online `_). diff --git a/docs/modules/jobstores/rethinkdb.rst b/docs/modules/jobstores/rethinkdb.rst deleted file mode 100644 index e43ebf4..0000000 --- a/docs/modules/jobstores/rethinkdb.rst +++ /dev/null @@ -1,25 +0,0 @@ -:mod:`apscheduler.jobstores.rethinkdb` -====================================== - -.. automodule:: apscheduler.jobstores.rethinkdb - -API ---- - -.. autoclass:: RethinkDBJobStore(database='apscheduler', table='jobs', client=None, pickle_protocol=pickle.HIGHEST_PROTOCOL, **connect_args) - :show-inheritance: - - -Introduction ------------- - -RethinkDBJobStore stores jobs in a `RethinkDB `_ database. - -.. list-table:: - :widths: 1 4 - - * - External dependencies - - `rethinkdb `_ - * - Example - - ``examples/jobstores/rethinkdb_.py`` - (`view online `_). diff --git a/docs/modules/jobstores/sqlalchemy.rst b/docs/modules/jobstores/sqlalchemy.rst deleted file mode 100644 index bde80c1..0000000 --- a/docs/modules/jobstores/sqlalchemy.rst +++ /dev/null @@ -1,28 +0,0 @@ -:mod:`apscheduler.jobstores.sqlalchemy` -======================================= - -.. automodule:: apscheduler.jobstores.sqlalchemy - -API ---- - -.. autoclass:: SQLAlchemyJobStore(url=None, engine=None, tablename='apscheduler_jobs', metadata=None, pickle_protocol=pickle.HIGHEST_PROTOCOL) - :show-inheritance: - - -Introduction ------------- - -SQLAlchemyJobStore stores jobs in any relational database management system supported by -`SQLAlchemy `_. It can use either a preconfigured -`Engine `_ or you can pass it a -connection URL. - -.. list-table:: - :widths: 1 4 - - * - External dependencies - - `SQLAlchemy `_ (+ the backend specific driver package) - * - Example - - ``examples/jobstores/sqlalchemy_.py`` - (`view online `_). diff --git a/docs/modules/jobstores/zookeeper.rst b/docs/modules/jobstores/zookeeper.rst deleted file mode 100644 index 9dfa389..0000000 --- a/docs/modules/jobstores/zookeeper.rst +++ /dev/null @@ -1,25 +0,0 @@ -:mod:`apscheduler.jobstores.zookeeper` -====================================== - -.. automodule:: apscheduler.jobstores.zookeeper - -API ---- - -.. autoclass:: ZooKeeperJobStore(path='/apscheduler', client=None, close_connection_on_exit=False, pickle_protocol=pickle.HIGHEST_PROTOCOL, **connect_args) - :show-inheritance: - - -Introduction ------------- - -ZooKeeperJobStore stores jobs in an `Apache ZooKeeper `_ instance. - -.. list-table:: - :widths: 1 4 - - * - External dependencies - - `kazoo `_ - * - Example - - ``examples/jobstores/zookeeper.py`` - (`view online `_). diff --git a/docs/modules/schedulers.rst b/docs/modules/schedulers.rst deleted file mode 100644 index 18e1649..0000000 --- a/docs/modules/schedulers.rst +++ /dev/null @@ -1,5 +0,0 @@ -:mod:`apscheduler.schedulers` -============================= - -.. automodule:: apscheduler.schedulers - :members: diff --git a/docs/modules/schedulers/asyncio.rst b/docs/modules/schedulers/asyncio.rst deleted file mode 100644 index db8a07d..0000000 --- a/docs/modules/schedulers/asyncio.rst +++ /dev/null @@ -1,32 +0,0 @@ -:mod:`apscheduler.schedulers.asyncio` -===================================== - -.. automodule:: apscheduler.schedulers.asyncio - -API ---- - -.. autoclass:: AsyncIOScheduler - :show-inheritance: - - -Introduction ------------- - -AsyncIOScheduler was meant to be used with the `AsyncIO `_ event loop. -By default, it will run jobs in the event loop's thread pool. - -If you have an application that runs on an AsyncIO event loop, you will want to use this scheduler. - -.. list-table:: - :widths: 1 4 - - * - Default executor - - :class:`~apscheduler.executors.asyncio.AsyncIOExecutor` - * - External dependencies - - * Python >= 3.4: none - * Python 3.3: `asyncio `_ - * Python <= 3.2: `trollius `_ - * - Example - - ``examples/schedulers/asyncio_.py`` - (`view online `_). diff --git a/docs/modules/schedulers/background.rst b/docs/modules/schedulers/background.rst deleted file mode 100644 index b12cd20..0000000 --- a/docs/modules/schedulers/background.rst +++ /dev/null @@ -1,29 +0,0 @@ -:mod:`apscheduler.schedulers.background` -======================================== - -.. automodule:: apscheduler.schedulers.background - -API ---- - -.. autoclass:: BackgroundScheduler - :show-inheritance: - - -Introduction ------------- - -BackgroundScheduler runs in a thread **inside** your existing application. Calling -:meth:`~apscheduler.schedulers.blocking.BackgroundScheduler.start` will start the scheduler and it will continue running -after the call returns. - -.. list-table:: - :widths: 1 4 - - * - Default executor - - :class:`~apscheduler.executors.pool.PoolExecutor` - * - External dependencies - - none - * - Example - - ``examples/schedulers/background.py`` - (`view online `_). diff --git a/docs/modules/schedulers/base.rst b/docs/modules/schedulers/base.rst deleted file mode 100644 index fecacca..0000000 --- a/docs/modules/schedulers/base.rst +++ /dev/null @@ -1,6 +0,0 @@ -:mod:`apscheduler.schedulers.base` -================================== - -.. automodule:: apscheduler.schedulers.base - :members: - :member-order: bysource diff --git a/docs/modules/schedulers/blocking.rst b/docs/modules/schedulers/blocking.rst deleted file mode 100644 index d923471..0000000 --- a/docs/modules/schedulers/blocking.rst +++ /dev/null @@ -1,30 +0,0 @@ -:mod:`apscheduler.schedulers.blocking` -====================================== - -.. automodule:: apscheduler.schedulers.blocking - -API ---- - -.. autoclass:: BlockingScheduler - :show-inheritance: - - -Introduction ------------- - -BlockingScheduler is the simplest possible scheduler. It runs in the foreground, so when you call -:meth:`~apscheduler.schedulers.blocking.BlockingScheduler.start`, the call never returns. - -BlockingScheduler can be useful if you want to use APScheduler as a standalone scheduler (e.g. to build a daemon). - -.. list-table:: - :widths: 1 4 - - * - Default executor - - :class:`~apscheduler.executors.pool.PoolExecutor` - * - External dependencies - - none - * - Example - - ``examples/schedulers/blocking.py`` - (`view online `_). diff --git a/docs/modules/schedulers/gevent.rst b/docs/modules/schedulers/gevent.rst deleted file mode 100644 index c71cedb..0000000 --- a/docs/modules/schedulers/gevent.rst +++ /dev/null @@ -1,28 +0,0 @@ -:mod:`apscheduler.schedulers.gevent` -==================================== - -.. automodule:: apscheduler.schedulers.gevent - -API ---- - -.. autoclass:: GeventScheduler - :show-inheritance: - - -Introduction ------------- - -GeventScheduler was meant to be used with applications that use `gevent `_. -GeventScheduler uses gevent natively, so it doesn't require monkey patching. By default it executes jobs as greenlets. - -.. list-table:: - :widths: 1 4 - - * - Default executor - - :class:`~apscheduler.executors.gevent.GeventExecutor` - * - External dependencies - - `gevent `_ - * - Example - - ``examples/schedulers/gevent_.py`` - (`view online `_). diff --git a/docs/modules/schedulers/tornado.rst b/docs/modules/schedulers/tornado.rst deleted file mode 100644 index 90c5a54..0000000 --- a/docs/modules/schedulers/tornado.rst +++ /dev/null @@ -1,27 +0,0 @@ -:mod:`apscheduler.schedulers.tornado` -===================================== - -.. automodule:: apscheduler.schedulers.tornado - -API ---- - -.. autoclass:: TornadoScheduler - :show-inheritance: - - -Introduction ------------- - -TornadoScheduler was meant to be used in `Tornado `_ applications. - -.. list-table:: - :widths: 1 4 - - * - Default executor - - :class:`~apscheduler.executors.pool.PoolExecutor` - * - External dependencies - - `tornado `_ - * - Example - - ``examples/schedulers/tornado_.py`` - (`view online `_) diff --git a/docs/modules/schedulers/twisted.rst b/docs/modules/schedulers/twisted.rst deleted file mode 100644 index 21c0b3c..0000000 --- a/docs/modules/schedulers/twisted.rst +++ /dev/null @@ -1,28 +0,0 @@ -:mod:`apscheduler.schedulers.twisted` -===================================== - -.. automodule:: apscheduler.schedulers.twisted - -API ---- - -.. autoclass:: TwistedScheduler - :show-inheritance: - - -Introduction ------------- - -TwistedScheduler was meant to be used in `Twisted `_ applications. -By default it uses the reactor's thread pool to execute jobs. - -.. list-table:: - :widths: 1 4 - - * - Default executor - - :class:`~apscheduler.executors.twisted.TwistedExecutor` - * - External dependencies - - `twisted `_ - * - Example - - ``examples/schedulers/twisted_.py`` - (`view online `_). diff --git a/docs/modules/triggers/base.rst b/docs/modules/triggers/base.rst deleted file mode 100644 index 91a9650..0000000 --- a/docs/modules/triggers/base.rst +++ /dev/null @@ -1,10 +0,0 @@ -:mod:`apscheduler.triggers.base` -================================ - -.. automodule:: apscheduler.triggers.base - -API ---- - -.. autoclass:: BaseTrigger - :members: diff --git a/docs/modules/triggers/calendarinterval.rst b/docs/modules/triggers/calendarinterval.rst deleted file mode 100644 index 53d3c51..0000000 --- a/docs/modules/triggers/calendarinterval.rst +++ /dev/null @@ -1,64 +0,0 @@ -:mod:`apscheduler.triggers.calendarinterval` -============================================ - -.. automodule:: apscheduler.triggers.calendarinterval - -API ---- - -Trigger alias for :meth:`~apscheduler.schedulers.base.BaseScheduler.add_job`: ``calendarinterval`` - -.. autoclass:: CalendarIntervalTrigger - :show-inheritance: - - -Introduction ------------- - -This method schedules jobs to be run on calendar-based intervals, always at the same wall-clock -time. You can specify years, months, weeks and days as the interval, and they will be added to the -previous fire time in that order when calculating the next fire time. - -You can also specify the starting date and ending dates for the schedule through the ``start_date`` -and ``end_date`` parameters, respectively. They can be given as a date/datetime object or text (in -the `ISO 8601 `_ format). - -If the start date is in the past, the trigger will not fire many times retroactively but instead -calculates the next run time from the current time, based on the past start time. - - -Examples --------- - -:: - - from datetime import datetime - - from apscheduler.schedulers.blocking import BlockingScheduler - - - def job_function(): - print("Hello World") - - sched = BlockingScheduler() - - # Schedule job_function to be called every month at 15:36:00, starting from today - sched.add_job(job_function, 'calendarinterval', months=1, hour=15, minute=36) - - sched.start() - - -You can use ``start_date`` and ``end_date`` to limit the total time in which the schedule runs:: - - # The same as before, but starts on 2019-06-16 and stops on 2020-03-16 -   sched.add_job(job_function, 'calendarinterval', months=2, start_date='2019-06-16', - end_date='2020-03-16', hour=15, minute=36) - - -The :meth:`~apscheduler.schedulers.base.BaseScheduler.scheduled_job` decorator works nicely too:: - - from apscheduler.scheduler import BlockingScheduler - - @sched.scheduled_job('calendarinterval', id='my_job_id', weeks=2) - def job_function(): - print("Hello World") diff --git a/docs/modules/triggers/combining.rst b/docs/modules/triggers/combining.rst deleted file mode 100644 index 856cc60..0000000 --- a/docs/modules/triggers/combining.rst +++ /dev/null @@ -1,35 +0,0 @@ -:mod:`apscheduler.triggers.combining` -===================================== - -These triggers combine the behavior of other triggers in different ways to produce schedules more -complex than would be possible with any single built-in trigger. - -.. automodule:: apscheduler.triggers.combining - -API ---- - -.. autoclass:: AndTrigger - -.. autoclass:: OrTrigger - - -Examples --------- - -Run ``job_function`` every 2 hours, but only on Saturdays and Sundays:: - - from apscheduler.triggers.combining import AndTrigger - from apscheduler.triggers.interval import IntervalTrigger - from apscheduler.triggers.cron import CronTrigger - - - trigger = AndTrigger([IntervalTrigger(hours=2), - CronTrigger(day_of_week='sat,sun')]) - scheduler.add_job(job_function, trigger) - -Run ``job_function`` every Monday at 2pm and every Tuesday at 3pm:: - - trigger = OrTrigger([CronTrigger(day_of_week='mon', hour=2), - CronTrigger(day_of_week='tue', hour=3)]) - scheduler.add_job(job_function, trigger) diff --git a/docs/modules/triggers/cron.rst b/docs/modules/triggers/cron.rst deleted file mode 100644 index 4758321..0000000 --- a/docs/modules/triggers/cron.rst +++ /dev/null @@ -1,113 +0,0 @@ -:mod:`apscheduler.triggers.cron` -================================ - -.. automodule:: apscheduler.triggers.cron - -API ---- - -Trigger alias for :meth:`~apscheduler.schedulers.base.BaseScheduler.add_job`: ``cron`` - -.. autoclass:: CronTrigger - :show-inheritance: - - -Introduction ------------- - -This is the most powerful of the built-in triggers in APScheduler. You can specify a variety of different expressions -on each field, and when determining the next execution time, it finds the earliest possible time that satisfies the -conditions in every field. This behavior resembles the "Cron" utility found in most UNIX-like operating systems. - -You can also specify the starting date and ending dates for the cron-style schedule through the ``start_time`` and -``end_time`` parameters, respectively. They can be given as a date/datetime object or text (in the -`ISO 8601 `_ format). - -Unlike with crontab expressions, you can omit fields that you don't need. Fields greater than the least significant -explicitly defined field default to ``*`` while lesser fields default to their minimum values except for ``week`` and -``day_of_week`` which default to ``*``. For example, ``day=1, minute=20`` is equivalent to -``year='*', month='*', day=1, week='*', day_of_week='*', hour='*', minute=20, second=0``. The job will then execute -on the first day of every month on every year at 20 minutes of every hour. The code examples below should further -illustrate this behavior. - -.. note:: The behavior for omitted fields was changed in APScheduler 2.0. - Omitted fields previously always defaulted to ``*``. - - -Expression types ----------------- - -The following table lists all the available expressions for use in the fields from year to second. -Multiple expression can be given in a single field, separated by commas. - -============== ===== ======================================================================================= -Expression Field Description -============== ===== ======================================================================================= -``*`` any Fire on every value -``*/a`` any Fire every ``a`` values, starting from the minimum -``a-b`` any Fire on any value within the ``a-b`` range (a must be smaller than b) -``a-b/c`` any Fire every ``c`` values within the ``a-b`` range -``xth y`` day Fire on the ``x`` -th occurrence of weekday ``y`` within the month -``last x`` day Fire on the last occurrence of weekday ``x`` within the month -``last`` day Fire on the last day within the month -``x,y,z`` any Fire on any matching expression; can combine any number of any of the above expressions -============== ===== ======================================================================================= - -.. note:: The ``month`` and ``day_of_week`` fields accept abbreviated English month and weekday names - (``jan`` – ``dec`` and ``mon`` – ``sun``) respectively. - - -Daylight saving time behavior ------------------------------ - -The cron trigger works with the so-called "wall clock" time. Thus, if the selected time zone observes DST (daylight -saving time), you should be aware that it may cause unexpected behavior with the cron trigger when entering or leaving -DST. When switching from standard time to daylight saving time, clocks are moved either one hour or half an hour -forward, depending on the time zone. Likewise, when switching back to standard time, clocks are moved one hour or half -an hour backward. This will cause some time periods to either not exist at all, or be repeated. If your schedule would -have the job executed on either one of these periods, it may execute more often or less often than expected. -This is not a bug. If you wish to avoid this, either use a timezone that does not observe DST, for instance UTC. -Alternatively, just find out about the DST switch times and avoid them in your scheduling. - -For example, the following schedule may be problematic:: - - # In the Europe/Helsinki timezone, this will not execute at all on the last sunday morning of March - # Likewise, it will execute twice on the last sunday morning of October - sched.add_job(job_function, 'cron', hour=3, minute=30) - - -Examples --------- - -:: - - from apscheduler.schedulers.blocking import BlockingScheduler - - - def job_function(): - print "Hello World" - - sched = BlockingScheduler() - - # Schedules job_function to be run on the third Friday - # of June, July, August, November and December at 00:00, 01:00, 02:00 and 03:00 - sched.add_job(job_function, 'cron', month='6-8,11-12', day='3rd fri', hour='0-3') - - sched.start() - - -You can use ``start_time`` and ``end_time`` to limit the total time in which the schedule runs:: - - # Runs from Monday to Friday at 5:30 (am) until 2014-05-30 00:00:00 - sched.add_job(job_function, 'cron', day_of_week='mon-fri', hour=5, minute=30, end_time='2014-05-30') - - -The :meth:`~apscheduler.schedulers.base.BaseScheduler.scheduled_job` decorator works nicely too:: - - @sched.scheduled_job('cron', id='my_job_id', day='last sun') - def some_decorated_task(): - print("I am printed at 00:00:00 on the last Sunday of every month!") - -To schedule a job using a standard crontab expression:: - - sched.add_job(job_function, CronTrigger.from_crontab('0 0 1-15 may-aug *')) diff --git a/docs/modules/triggers/date.rst b/docs/modules/triggers/date.rst deleted file mode 100644 index 93d3624..0000000 --- a/docs/modules/triggers/date.rst +++ /dev/null @@ -1,59 +0,0 @@ -:mod:`apscheduler.triggers.date` -================================ - -.. automodule:: apscheduler.triggers.date - -API ---- - -Trigger alias for :meth:`~apscheduler.schedulers.base.BaseScheduler.add_job`: ``date`` - -.. autoclass:: DateTrigger - :show-inheritance: - - -Introduction ------------- - -This is the simplest possible method of scheduling a job. It schedules a job to be executed once at the specified time. -It is APScheduler's equivalent to the UNIX "at" command. - -The ``run_date`` can be given either as a date/datetime object or text (in the -`ISO 8601 `_ format). - - -Examples --------- - -:: - - from datetime import date - - from apscheduler.schedulers.blocking import BlockingScheduler - - - sched = BlockingScheduler() - - def my_job(text): - print(text) - - # The job will be executed on November 6th, 2009 - sched.add_job(my_job, 'date', run_date=date(2009, 11, 6), args=['text']) - - sched.start() - - -You can specify the exact time when the job should be run:: - - # The job will be executed on November 6th, 2009 at 16:30:05 - sched.add_job(my_job, 'date', run_date=datetime(2009, 11, 6, 16, 30, 5), args=['text']) - - -The run date can be given as text too:: - - sched.add_job(my_job, 'date', run_date='2009-11-06 16:30:05', args=['text']) - -To add a job to be run immediately:: - - # The 'date' trigger and datetime.now() as run_date are implicit - sched.add_job(my_job, args=['text']) diff --git a/docs/modules/triggers/interval.rst b/docs/modules/triggers/interval.rst deleted file mode 100644 index df7a593..0000000 --- a/docs/modules/triggers/interval.rst +++ /dev/null @@ -1,61 +0,0 @@ -:mod:`apscheduler.triggers.interval` -==================================== - -.. automodule:: apscheduler.triggers.interval - -API ---- - -Trigger alias for :meth:`~apscheduler.schedulers.base.BaseScheduler.add_job`: ``interval`` - -.. autoclass:: IntervalTrigger - :show-inheritance: - - -Introduction ------------- - -This method schedules jobs to be run periodically, on selected intervals. - -You can also specify the starting date and ending dates for the schedule through the ``start_time`` and ``end_time`` -parameters, respectively. They can be given as a date/datetime object or text (in the -`ISO 8601 `_ format). - -If the start time is in the past, the trigger will not fire many times retroactively but instead calculates the next -run time from the current time, based on the past start time. - - -Examples --------- - -:: - - from datetime import datetime - - from apscheduler.schedulers.blocking import BlockingScheduler - - - def job_function(): - print("Hello World") - - sched = BlockingScheduler() - - # Schedule job_function to be called every two hours - sched.add_job(job_function, 'interval', hours=2) - - sched.start() - - -You can use ``start_time`` and ``end_time`` to limit the total time in which the schedule runs:: - - # The same as before, but starts on 2010-10-10 at 9:30 and stops on 2014-06-15 at 11:00 -   sched.add_job(job_function, 'interval', hours=2, start_time='2010-10-10 09:30:00', end_time='2014-06-15 11:00:00') - - -The :meth:`~apscheduler.schedulers.base.BaseScheduler.scheduled_job` decorator works nicely too:: - - from apscheduler.scheduler import BlockingScheduler - - @sched.scheduled_job('interval', id='my_job_id', hours=2) - def job_function(): - print("Hello World") diff --git a/docs/py-modindex.rst b/docs/py-modindex.rst deleted file mode 100644 index 3cdb8ca..0000000 --- a/docs/py-modindex.rst +++ /dev/null @@ -1,2 +0,0 @@ -API reference -============= -- cgit v1.2.1