Skip to main content

Runium

PyPI version shields.io PyPI pyversions Documentation Status GitHub license

Runium is a Python library that makes it easy to write non-blocking, asynchronous tasks.

You can add new tasks as you please, choose when and how to execute them as Threads or Processes and attach callbacks to be executed as soon as the task is finished running. Run those tasks once or periodically or schedule to run them at a specific time.

The purpose of Runium is to do these simple, easy and clean with minimum to no changes to your code. Just one line of code is all it takes.

Documentation https://runium.readthedocs.io/en/latest/main.html

Pypi: https://pypi.org/project/runium/

Features

  • Concurrency: Run a task once or many times in its own Thread or Process.

  • Repetition: Run tasks periodically on even time intervals. Optionally for a certain amount of times.

  • Scheduling: Run tasks at a certain date and time.

  • Callbacks: Runium tasks can accept callback functions which are executed when the task is finished running.

  • Simplicity and Readability: Do all the above in a single line of code that is easy to read.

Installation

Runium is distributed on PyPI. The best way to install it is with pip:

$ pip install runium

Quickstart

from runium.core import Runium

# Initialize Runium
rn = Runium()

# Or you may want to run your tasks in Processes
rn = Runium(mode='multiprocessing')

# Create a task
async_task = rn.new_task(task)

# Attach callbacks (Check the documentation for callbacks)
async_task.on_finished(callback)

# or you can be more flexible...
async_task.on_success(s_callback).on_error(e_callback)

# Run it. This will return a future object.
future = async_task.run()

# Or if you want to run it multiple times
future = async_task.run(times=3)

# Or maybe run it 3 times every 1 hour
future = async_task.run(every='1 hour', times=3)

# Or tell Runium to start the task in a specific time
future = async_task.run(start_in='5 hours')

# Then you can wait for the result.
future.result()

# Of course you can do all these in one line :)
rn.new_task(task).run(every='1 second', times=3).result()

Release files for runium 0.1.8

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

Source distribution (sdist)

Source distribution for runium 0.1.8
File Size Uploaded
runium-0.1.8.tar.gz 6.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for runium 0.1.8
File Interpreter ABI Platform
runium-0.1.8-py3-none-any.whl Python 3 none any Details

Total release size: 15.2 kB

Release files / runium-0.1.8.tar.gz

Download URL runium-0.1.8.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1f3853f5b8cdf2c910982784bb3f4729ab17761e1f6dfd55208bce32aeb4e09b
BLAKE2b-256 checksum
How to use checksums
63337d95dee5c8fa5448b7be46654982587d581f2c37603fd5a646c4f802851d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

Release files / runium-0.1.8-py3-none-any.whl

Download URL runium-0.1.8-py3-none-any.whl
Size 8.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f9d1fc529cbe287940f2093ef94525a3ae33f1c7e6d92dd466dce4813a974326
BLAKE2b-256 checksum
How to use checksums
d0477e242c51f7d2e416f0cdf320375aa1f8bc64f576723050e266bf495c79e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.1.8 This release

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.0

2 release files

0.0.1

2 release files

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