{ "info": { "author": "David Davis", "author_email": "davisd@davisd.com", "bugtrack_url": null, "classifiers": [], "description": "==========\nSchedaddle\n==========\n\nSchedaddle is a Python package for getting dates and times on scheduled\nintervals.\n\nFor more information, see http://www.davisd.com/projects/python-schedaddle\n\nTypical Usage is as follows::\n\n #!/usr/bin/env python\n\n import schedaddle\n\n schedaddle.next((2010, 1, 31), 'monthly')\n\nAuthor\n======\n\nDavid Davis \nhttp://www.davisd.com\n\n\nAPI\n===\n\nThe entire Schedaddle api consists of one dictionary, two date functions, and\ntwo generator functions.\n\nDictionary\n----------\n\nA dictionary, KNOWN_INTERVALS is exposed by the Schedaddle API. This dictionary\nconsists of string keys representing known interval names with values as tuples\nin (year, month, day, hour, minute, second, microsecond) format.\n\n\nDate Functions\n--------------\n\nThe Schedaddle API exposes two date functions\n\nnext\n~~~~\n\nGet the next date/time tuple on a schedule.\n\nKeyword arguments:\n start_date -- the date that the schedule began/begins\n\n interval -- can be a string or a tuple.\n If a string - valid values are defined in KNOWN_INTERVALS \n \n If a tuple - (year, month, day, hour, minute, second, microsecond)\n \n latest -- the most recent date that the schedule ran (optional, if not\n provided, start_date will be treated as the latest)\n\nReturns a 7 value tuple (year, month, day, hour, minute, second, microsecond)\n\nExample:\n\n >>> import schedaddle\n >>> schedaddle.next((2010, 1, 31), 'monthly')\n (2010, 2, 28, 0, 0, 0, 0)\n \n >>> import schedaddle\n >>> schedaddle.next((2010, 1, 31), 'monthly', latest=(2010, 3, 15))\n (2010, 3, 31, 0, 0, 0, 0)\n\n\nnext_m\n~~~~~~\n\nGet the next identifiable date/time tuple resulting from an iterable of\nschedules.\n\nKeyword arguments:\n schedules -- an iterable of schedules\n a single schedule is a three value tuple consisting of (identifier,\n start_date, interval)\n \n latest -- the most recent date that the schedule ran (optional, if not\n provided, start_date will be treated as the latest for each schedule)\n\nReturns a two value tuple consisting of the identifier of the matching schedule,\nand the 7 value date/time tuple.\n(identifier, (year, month, day, hour, minute, second, microsecond))\n\nExample:\n\n >>> import schedaddle\n >>> schedaddle.next_m([\n ... ('first', (2010, 1, 31), 'monthly'),\n ... ('second', (2010, 1, 31), 'weekly')])\n ('second', (2010, 2, 7, 0, 0, 0, 0))\n\n >>> import schedaddle\n >>> schedaddle.next_m([\n ... ('first', (2010, 1, 31), (0, 1, 0, 0, 0, 0, 0)),\n ... ('second', (2010, 1, 31, 12, 30), 'weekly')],\n ... latest=(2010, 2, 21))\n ('first', (2010, 2, 28, 0, 0, 0, 0))\n \n\nGenerators\n----------\n\nThe Schedaddle API exposes two generator functions\n\nupcoming\n~~~~~~~~\n\nGet a generator that produces upcoming date/time tuples on a schedule.\n\nKeyword arguments:\n start_date -- the date that the schedule begain/begins\n \n interval -- can be a string or a tuple.\n If a string - valid values are defined in KNOWN_INTERVALS\n \n If a tuple - (year, month, day, hour, minute, second, microsecond)\n \n latest -- the most recent date that the schedule ran (optional, \n if not provided, start_date will be treated as the latest)\n \n end_date -- the last possible date in the generator (optional)\n \n max_dates -- the maximum number of dates the generator should\n return (optional)\n \nReturns a generator that yields 7 value date/time tuples\n(year, month, day, hour, minute, second, microsecond)\n\nNotes:\n If end_date or max_dates is not provided, there will be no end to the amount\n of dates generated, and so it should then not be used in scenarios requiring\n a finite number of results, such as list comprehention.\n \nExample:\n\n >>> import schedaddle\n >>> g = schedaddle.upcoming((2010, 1, 31, 12, 15), 'weekly', max_dates=3)\n >>> l = [s for s in g]\n >>> l\n [(2010, 2, 7, 12, 15, 0, 0), (2010, 2, 14, 12, 15, 0, 0), (2010, 2, 21, 12, 15, 0, 0)]\n\nupcoming_m\n~~~~~~~~~~\n\nGet a generator that produces upcoming, identifiable date/time tuples resulting\nfrom an iterable of schedules.\n\nGenerate upcoming dates from an iterable of schedules.\n\nKeyword arguments:\n schedules -- an iterable of schedules\n a single schedule is a tuple consisting of (identifier, start_date,\n interval)\n \n latest -- the most recent date that the schedule ran (optional, if not\n provided, start_date will be treated as the latest for each schedule)\n \n end_date -- the last possible date in the generator (optional)\n \n max_dates -- the maximum number of dates the generator should\n return (optional)\n\nReturns a generator that yields two value date/time tuples consisting of the\nidentifier of the matching schedule and the 7 value date/time tuple.\n(identifier, (year, month, day, hour, minute, second, microsecond))\n\nNotes:\n If end_date or max_dates is not provided, there will be no end to the amount\n of dates generated, and so it should then not be used in scenarios requiring\n a finite number of results, such as list comprehention.\n \nExample:\n\n >>> import schedaddle\n >>> schedule1 = ('first', (2010, 1, 5), 'weekly')\n >>> schedule2 = ('second', (2007, 12, 31), 'monthly')\n >>> g = schedaddle.upcoming_m(\n ... (schedule1, schedule2),\n ... latest=(2010, 1, 12))\n >>> g.next()\n ('first', (2010, 1, 19, 0, 0, 0, 0))\n >>> g.next()\n ('first', (2010, 1, 26, 0, 0, 0, 0))\n >>> g.next()\n ('second', (2010, 1, 31, 0, 0, 0, 0))\n\n\nNotes\n-----\n\nArguments\n~~~~~~~~~\n\nWhen a *date* is accepted as an argument in a function, you may use a date or\ndatetime object, or a tuple consisting of one to seven number values\n(year, month, day, hour, minute, second, microsecond).\nIf using tuple and values are not provided for each of the places (eg, no second\nor microsecond as in (2010, 1, 31, 12, 30)), Schedaddle will fill in the blanks\neither with zeros or with the maximum value to end the day, whichever makes\nsense for the argument's context.\n\nWhen an *interval* is accepted as an argument in a function, you may use a\nstring representing a known interval defined in the KNOWN_INTERVALS dictionary,\nOR you may represent an interval as a seven value tuple\n(years, months, days, hours, minutes, seconds, microseconds).\n\n\nReturn Values\n~~~~~~~~~~~~~\n\nThe functions *next* and *upcoming* return and yield a tuple consisting of seven\nvalues (year, month, day, hour, minute, second, microsecond).\n\nThe functions *next_m* and *upcoming_m* return and yield a tuple consisting of\ntwo values. The first value is the identifier that was passed as part of the\nschedule which was matched. The second is a tuple consisting of seven values\n(year, month, day, hour, minute, second, microsecond).", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://www.davisd.com/projects/python-schedaddle", "keywords": null, "license": "LICENSE", "maintainer": null, "maintainer_email": null, "name": "Schedaddle", "package_url": "https://pypi.org/project/Schedaddle/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/Schedaddle/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://www.davisd.com/projects/python-schedaddle" }, "release_url": "https://pypi.org/project/Schedaddle/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "Schedaddle is a python package for getting dates and times on scheduled intervals", "version": "0.1.0" }, "last_serial": 785604, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "0c01568bf3d1b18af02c99a79dfa1f0e", "sha256": "2ebf351685dba156e33cf1e7d428b5d07748eaff08670a9e7a22906947e3761c" }, "downloads": -1, "filename": "Schedaddle-0.1.0.tar.gz", "has_sig": false, "md5_digest": "0c01568bf3d1b18af02c99a79dfa1f0e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5927, "upload_time": "2011-11-23T20:21:23", "url": "https://files.pythonhosted.org/packages/da/1d/ec75b4451f867495b6cb7d76e381fc91904a73626e648fec99d5630b0a16/Schedaddle-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0c01568bf3d1b18af02c99a79dfa1f0e", "sha256": "2ebf351685dba156e33cf1e7d428b5d07748eaff08670a9e7a22906947e3761c" }, "downloads": -1, "filename": "Schedaddle-0.1.0.tar.gz", "has_sig": false, "md5_digest": "0c01568bf3d1b18af02c99a79dfa1f0e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5927, "upload_time": "2011-11-23T20:21:23", "url": "https://files.pythonhosted.org/packages/da/1d/ec75b4451f867495b6cb7d76e381fc91904a73626e648fec99d5630b0a16/Schedaddle-0.1.0.tar.gz" } ] }