Skip to main content

dmi-scheduler

A lightweight task scheduler in Python.

Installation

pip3 install dmi-scheduler

PostgreSQL is used to keep track of jobs. As such, you need to have a PostgreSQL database that the scheduler can interact with. Database tables will be created automatically if they don't exist yet. You can pass the database connection parameters to the Scheduler() constructor with the dbname, dbhost, dbuser, dbpassword and dbport keyword arguments.

Example

import time
from dmi_scheduler.scheduler import Scheduler

scheduler = Scheduler(config="scheduler.yml")
for i in range(0, 100):
    scheduler.queue.add_job("log_number.py")

while scheduler.has_jobs():
    time.sleep(1)

scheduler.end()
print("Done! Results can be found in the log file.") 

log_number.py:

from random import choice
from dmi_scheduler.worker import BasicWorker

class SomeWorker(BasicWorker):
	max_workers = 3

	def work(self):
		self.log.info("Here is a random number: %i" % choice(range(0,1000)))

License

This scraper was developed by the Digital Methods Initiative, and is distributed under the MIT license. See LICENSE for details.

Metadata

Release files for dmi-scheduler 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dmi-scheduler 0.6.0
File Size Uploaded Provenance Actions
dmi-scheduler-0.6.0.tar.gz 12.9 kB Without provenance Details for dmi-scheduler-0.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dmi-scheduler 0.6.0
File Interpreter ABI Platform Actions
dmi_scheduler-0.6.0-py3-none-any.whl Python 3 none any Details for dmi_scheduler-0.6.0-py3-none-any.whl

Total release size: 28.8 kB

Release files / dmi-scheduler-0.6.0.tar.gz

Download URL dmi-scheduler-0.6.0.tar.gz
Size 12.9 kB
Tags Source
SHA-256 checksum
How to use checksums
f3340f1a23554bf526372ff50d796c74a8de896afca1faba2cb2588d0fd6c41b
BLAKE2b-256 checksum
How to use checksums
26265d0b921b45efa37fcbf2819d21a28a3d2a212ddda8daae89574ca99fbb2a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.20.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.0

Release files / dmi_scheduler-0.6.0-py3-none-any.whl

Download URL dmi_scheduler-0.6.0-py3-none-any.whl
Size 15.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
98fb2d8482a14559a837a637bf0c54aeb151cc4b65aa8e70d842406a6a09b123
BLAKE2b-256 checksum
How to use checksums
709cbff4f641ac4972eaf8313915d89b1fd83672a184861ad37eb2bc4c479b4d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.20.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.0

Security for dmi-scheduler 0.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page