Metadata-Version: 1.1
Name: pyriodic
Version: 0.2
Summary: A scheduler written in Python using dateutil for periodic jobs.
Home-page: https://github.com/Ayehavgunne/pyriodic
Author: Anthony Post
Author-email: postanthony3000 at gmail com
License: Simplified BSD
Download-URL: https://raw.githubusercontent.com/Ayehavgunne/pyriodic/master/pyriodic.py
Description: ===
        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 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')
        
            # or use a decorator if there are no arguments needed in the function
            @sched.schedule_recuring_job(interval='minutely', start_time='12:30:45 PM')
            def run_test2():
                print('This is test 2.', datetime.now())
        
            run_test2()
        
        
        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)
          * *integer* **retry_delay** seconds to delay next run time after exception (default is 10  seconds right now)
          * *string* **name** the name that the job can then be refered to as (defaults to function name)
        
        Start dates and times are parsed by dateutil so it is flexible in what it excepts.
        
        Todo
        ====
        
        1. Add support for Weekly Intervals
          1. Add day_of_week option (currently there but doesn't do anything yet)
          2. Add ``weekly`` to the list of accepted intervals
        2. Add timezone awareness
        3. Add logging capability
        4. Add more options for error handling
          1. Add option for a waiting time before the next function call after an exception - Done!
          2. Add option for the number of retrys after exceptions - Done!
          3. Maybe add the option to execute a different function upon an exception
        5. Add docstrings
        6. Add options for retrieving the return values
          1. Add capturing of return variables into an OrderedDict (keys are the datetime that the return value was captured) for each job - Done!
          2. Add option for maximum number of stored return values
        7. Named Jobs - Done!
        
        Changelog
        =========
        
        Version 0.2
        -----------
        * Organized code a bit
        * Added named jobs
        * Added rudimentary capability to retrieve the return values from each job
        * Added ability to limit job to x number of failures and to set the delay after an exception
        
        Version 0.1
        -----------
         * Initial Release
Keywords: schedule periodic job
Platform: UNKNOWN
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Programming Language :: Python :: 3.3
Classifier: Intended Audience :: Developers
Requires: pyriodic
Requires: dateutils
