Skip to main content

Rocketry

The engine to power your Python apps

Test Test coverage Package version Supported Python versions


What is it?

Rocketry is a modern scheduling framework for Python applications. It is simple, clean and extensive. It is the automation engine that sets your Python programs alive.

The library is minimal on the surface but large and highly customizable underneath. The syntax very clean:

from rocketry import Rocketry

app = Rocketry()

@app.task('daily')
def do_daily():
    ...

if __name__ == '__main__':
    app.run()
Dislike the string syntax?

There is also a condition API which is almost identical to the string syntax:

from rocketry import Rocketry
from rocketry.conds import daily

app = Rocketry()

@app.task(daily)
def do_daily():
    ...

if __name__ == '__main__':
    app.run()

Compared to alternatives, Rocketry has the most elegant syntax and is the most productive. It offers more features than Crontab or APScheduler but is much easier to work with than Airflow. It does not make assumptions of your project.

Core functionalities:

  • Powerful scheduling syntax
  • A lot of built-in scheduling options
  • Task parallelization
  • Task parametrization
  • Task pipelining
  • Modifiable session also in runtime

Links:

Installation

Install Rocketry from PyPI:

pip install rocketry

More Examples

Here are some more examples of what it can do.

Scheduling:

@app.task("every 10 seconds")
def do_continuously():
    ...

@app.task("daily after 07:00")
def do_daily_after_seven():
    ...

@app.task("hourly & time of day between 22:00 and 06:00")
def do_hourly_at_night():
    ...

@app.task("(weekly on Monday | weekly on Saturday) & time of day after 10:00")
def do_twice_a_week_after_ten():
    ...
Same with condition API
from rocketry.conds import every, daily, hourly, time_of_day, weekly

@app.task(every("10 seconds"))
def do_continuously():
    ...

@app.task(daily.after("07:00"))
def do_daily_after_seven():
    ...

@app.task(hourly & time_of_day.between("22:00", "06:00"))
def do_hourly_at_night():
    ...

@app.task((weekly.on("Monday") | weekly.on("Saturday")) & time_of_day.after("10:00"))
def do_twice_a_week_after_ten():
    ...

Pipelining tasks:

from rocketry.args import Return

@app.task("daily after 07:00")
def do_first():
    ...
    return 'Hello World'

@app.task("after task 'do_first'")
def do_second(arg=Return('do_first')):
    # arg contains the value of the task do_first's return
    ...
    return 'Hello Python'
Same with condition API
from rocketry.conds import daily, after_success
from rocketry.args import Return

@app.task(daily.after("07:00"))
def do_first():
    ...
    return 'Hello World'

@app.task(after_success(do_first))
def do_second(arg=Return(do_first)):
    # arg contains the value of the task do_first's return
    ...
    return 'Hello Python'

Parallelizing tasks:

@app.task("daily", execution="main")
def do_unparallel():
    ...

@app.task("daily", execution="thread")
def do_on_separate_thread():
    ...

@app.task("daily", execution="process")
def do_on_separate_process():
    ...

Interested?

Read more from the documentation.

About Library

Release files for rocketry 2.1.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 rocketry 2.1.0
File Size Uploaded
rocketry-2.1.0.tar.gz 133.7 kB Details

Built distribution (wheel)

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

Total release size: 302.9 kB

Release files / rocketry-2.1.0.tar.gz

Download URL rocketry-2.1.0.tar.gz
Size 133.7 kB
Tags Source
SHA-256 checksum
How to use checksums
8a881733e168511e82eb7ec1205a560e160f8d9bb06fdd07233f03060c087165
BLAKE2b-256 checksum
How to use checksums
582f0b17fdce0f944456511920878d55586e597e6edb9429aa9a48e93a81a9d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

Release files / rocketry-2.1.0-py3-none-any.whl

Download URL rocketry-2.1.0-py3-none-any.whl
Size 169.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
351d48e9ae2ee89adc4dda98a3e0344615271ddd7bf2fbdde94d76a5a83feaa6
BLAKE2b-256 checksum
How to use checksums
ba12efd93c57cf82515fdb0e10878fb15aa68e0e0148155522598330c5a0216b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

Release history Release notifications | RSS feed

2.5.1

2 release files

2.5.0

2 release files

2.4.1

2 release files

2.4.0

2 release files

2.3.0

2 release files

2.2.0

2 release files

2.1.2

2 release files

2.1.1

2 release files

This release

2.1.0 This release

2 release files

2.0.1

2 release files

2.0.0

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