skip to navigation
skip to content

Not Logged In

pyriodic 0.1.2

A scheduler written in Python using dateutil for periodic jobs.

Latest Version: 0.2.4

===========
pyriodic
===========

**pyriodic** is a scheduler written in Python using dateutil to run periodic jobs.

This project was just started and is in the alpha stage so there is a lot yet to do.
It is coded in Python 3.3; other versions of Python have yet to be tested.

Usage
=========

Schedule recurring jobs by specifying at least a desired **interval** as a string.

Example
-------------
::
from pyriodic.pyriodic import Scheduler

print('Program starting at', datetime.now())
sched = Scheduler()
message = 'Hello from argumentland.'

def run_test1(mes):
print('This is test 1.', mes, datetime.now())

sched.add_recuring_job(run_test1, args=(message,), interval='hourly')

# You can also use a decorator!
@sched.schedule_recuring_job(interval='minutely', start_time='12:30:45 PM')
def run_test2():
print('This is test 2.', datetime.now())

Output
-------------

Program starting at 2014-05-24 21:19:34.029764
This is test 1. Hello from argumentland. 2014-05-24 21:19:34.528792
This is test 1. Hello from argumentland. 2014-05-24 21:20:00.000249
This is test 2. 2014-05-24 21:20:15.000107
This is test 1. Hello from argumentland. 2014-05-24 21:20:59.999681
This is test 2. 2014-05-24 21:21:14.999539

Intervals included are:
* yearly (haven't had the **time** to test this one out yet)
* monthly (nor this one)
* daily
* hourly
* minutely
* secondly

Other parameters include:
* *string* **start_date** (defaults to today's date)
* *string* **start_time** (defaults to midnight)
* *integer* **how_many** intervals to run (default is infinite)
* *integer* **retrys** upon exceptions (default is 3 times)

Start dates and times are parsed by dateutil so it is flexible in what it excepts.

Todo
=========

1. Add day_of_week option
2. Add weekly to the list of accepted intervals
3. Add timezone awareness
4. Add logging capability
5. Add option for a waiting time before the next function call after an exception
6. Maybe add the option to execute a different function upon an exception

Changelog
=========

Version 0.1
-------------
* Initial Release  
File Type Py Version Uploaded on Size
pyriodic-0.1.2.zip (md5) Source 2014-05-25 4KB
  • Downloads (All Versions):
  • 86 downloads in the last day
  • 570 downloads in the last week
  • 2067 downloads in the last month