{ "info": { "author": "Todor Bukov", "author_email": "Todor Bukov ", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "License :: OSI Approved :: GNU General Public License (GPL)", "Operating System :: Microsoft :: Windows", "Operating System :: OS Independent", "Operating System :: POSIX", "Operating System :: Unix", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: Implementation :: CPython" ], "description": "Installing and using Timerange\n==============================\n\n**timerange** is a command line script to generate a range of date/times in \nvarious formats.\nIt is used to produce list of date/times that can then be passed to other\nprograms or used in shell/batch scripts where operations with date and times\nare required. \n\nIt can also be compiled for Windows (with py2exe_).\n\n\nInstallation instructions\n--------------------------\n\nTimerange is a single Python script with no external dependencies beyond\nstandard Python library. Installing from source is the usual::\n\n python setup.py install\n\n\nUnder Windows py2exe_ tool is used to generate singe exe binary::\n\n python setup.py py2exe\n\n\nThe resulting timerange.exe is in the dist/ folder.\n\n\nUsage\n=====\n\nGetting help on the command line options::\n\n C:\\> timerange --help\n usage: timerange [-h] [-d DEBUG_LEVEL] [-s START] [-e END] [-p PERIOD]\n [-o OUTPUT_FORMAT] [-i INPUT_FORMAT] [-fh] [-v]\n \n timerange - generates a range of date/times in various formats\n \n optional arguments:\n -h, --help show this help message and exit\n -d DEBUG_LEVEL, --debug DEBUG_LEVEL\n Sets the debug level and adds debug messages to the\n output\n -s START, --start START\n Date to start from (format \"YYYY-MM-DD\", \"today\",\n \"+7days\" or \"-2hours\")\n -e END, --end END End date (format \"YYYY-MM-DD\", \"today\", \"+7days\" or\n \"-2days\")\n -p PERIOD, --period PERIOD\n Period term - examples: \"1 hour\", \"-2 days\", \"3\n months, 5 days\"\n -o OUTPUT_FORMAT, --output-format OUTPUT_FORMAT\n Output format string. Use --format-help option for\n more details\n -i INPUT_FORMAT, --input-format INPUT_FORMAT\n Input format string. Use --format-help option for more\n details\n -fh, --format_help Show the format strings available for date/time input\n and output\n -v, --version Show the version\n \n author: Todor Bukov ver.1.06\n\n\nGetting help on the input and output formats::\n\n \n Available arguments for the date/time format options (-i/-o)\n \n %a \tLocale's abbreviated weekday name. \t \n %A \tLocale's full weekday name. \t \n %b \tLocale's abbreviated month name. \t \n %B \tLocale's full month name. \t \n %c \tLocale's appropriate date and time representation. \t \n %d \tDay of the month as a decimal number [01,31]. \t \n %H \tHour (24-hour clock) as a decimal number [00,23]. \t \n %I \tHour (12-hour clock) as a decimal number [01,12]. \t \n %j \tDay of the year as a decimal number [001,366]. \t \n %m \tMonth as a decimal number [01,12]. \t \n %M \tMinute as a decimal number [00,59]. \t \n %p \tLocale's equivalent of either AM or PM. \t(1)\n %S \tSecond as a decimal number [00,61]. \t(2)\n %U \tWeek number of the year (Sunday as the first day of the week) as a decimal number [00,53]. All days in a new year preceding the first Sunday are considered to be in week 0. \t(3)\n %w \tWeekday as a decimal number [0(Sunday),6]. \t \n %W \tWeek number of the year (Monday as the first day of the week) as a decimal number [00,53]. All days in a new year preceding the first Monday are considered to be in week 0. \t(3)\n %x \tLocale's appropriate date representation. \t \n %X \tLocale's appropriate time representation. \t \n %y \tYear without century as a decimal number [00,99]. \t \n %Y \tYear with century as a decimal number. \t \n %Z \tTime zone name (no characters if no time zone exists). \t \n %% \tA literal '%' character.\n \n Notes:\n \n (1) When used with the strptime() function, the %p directive only affects the output hour field if the %I directive is used to parse the hour.\n (2) The range really is 0 to 61; this accounts for leap seconds and the (very rare) double leap seconds.\n (3) When used with the strptime() function, %U and %W are only used in calculations when the day of the week and the year are specified.\n \n Examples:\n \"%Y%-m-%d\" results in something like \"2012-01-01\" (the actual date depends on the other parameters).\n \n Dates can also be defined as relative to the current date/time using sign i.e. \"+\" and \"-\" or by using the keywords \"from now\" and \"ago\".\n \n List of relative keywords:\n - \"now\" - refers to the current time on the system\n - \"today\" - same as \"now\", but with the time part zeroed (i.e. 00:00:00)\n - \"yesterday\" - same as \"now, -1 day\"\n - \"tomorrow\" - same as \"now, +1 day\"\n - \"ago\" - refers to the period in the past e.g. \"1 day ago\" is the same as \"-1 day\"\n - \"from now\" - refers to the period in the future (this is the default) e.g. \"1 day\", \"+1 day\", \"1 day from now\" are all the same.\n \n Examples:\n \"1 day ago\", \"2 weeks from now\", \"-1 hour\", \"+2 minutes\", \"today\", \"tomorrow\"\n \n When using relative dates more than one keyword can be provided, seprated by comma.\n Examples:\n \"1 day, 2 hours, 3 minutes\" or \"-3 days, -2 seconds\"\n \n NOTE: Combinations of keywords can sometimes lead to confusing results i.e. \"+3days, -1 hour, 2 minutes ago\". \n These combinations are additive and the final results is the sum of the results yelded by the individual keywords.\n \n\nShowing today's date::\n\n C:\\> timerange\n 2012-01-29 00:00:00\n\n C:\\> timerange.exe -s \"now\" -e \"now, 1 sec\"\n 2012-01-29 11:21:10\n\n\nGenerating list of (relative) dates with specified period between them with\nthe command line option -p/--period::\n\n C:\\> timerange -s \"now\" -e \"tomorrow\" -p \"6 hours\"\n 2012-01-29 11:23:04\n 2012-01-29 17:23:04\n 2012-01-29 23:23:04\n 2012-01-30 05:23:04\n 2012-01-30 11:23:04\n\n\nThe relative dates can be combined with the tokens separated by comma::\n\n C:\\> timerange -s \"-3 days, -2 hours\" -e \"tomorrow, +1 day\" -p \"22 hours\"\n 2012-01-26 09:24:06\n 2012-01-27 07:24:06\n 2012-01-28 05:24:06\n 2012-01-29 03:24:06\n 2012-01-30 01:24:06\n 2012-01-30 23:24:06\n\n\nGenerating a date range between two (absolute) dates::\n\n C:\\> timerange -s 2012-01-01 -e 2013-01-01 -p \"2 months, 2 days\"\n ERROR: Could not convert the argument: '2012-01-01' using the format '%Y-%m-%d %H:%M:%S (time data '2012-01-01' does not match format '%Y-%m-%d %H:%M:%S')\n\n\nThe error is due to the dates being in format that is not expected by the\nscript. The input format may be changed using -i/--input-format option\n(check the output from the -fh command option for the meaning of the format\nletters)::\n\n C:\\> timerange -s 2012-01-01 -i \"%Y-%m-%d\" -e 2013-01-01 -p \"2 months, 2 days\"\n 2012-01-01 00:00:00\n 2012-03-03 00:00:00\n 2012-05-04 00:00:00\n 2012-07-05 00:00:00\n 2012-09-05 00:00:00\n 2012-11-06 00:00:00\n\n\nThe output format can also be changed using the -o/--output-format option::\n\n C:\\> timerange -s 2012-01-01 -i \"%Y-%m-%d\" -e 2013-01-01 -p \"2 months, 2 days\" -o \"%b %d, %Y\"\n Jan 01, 2012\n Mar 03, 2012\n May 04, 2012\n Jul 05, 2012\n Sep 05, 2012\n Nov 06, 2012\n\n\nThe dates can also be in descending order providing the period is negative::\n\n C:\\> timerange.exe -s \"tomorrow\" -e \"-3 days\" -p \"-12 hours, -5 minute, -30 secs\"\n 2012-01-30 11:26:10\n 2012-01-29 23:20:40\n 2012-01-29 11:15:10\n 2012-01-28 23:09:40\n 2012-01-28 11:04:10\n 2012-01-27 22:58:40\n 2012-01-27 10:53:10\n 2012-01-26 22:47:40\n\n\nIf the start/end date and the period as such that it may cause infinite loop,\nthen an error will be thrown::\n\n C:\\> timerange.exe -s \"tomorrow\" -e \"yesterday\" -p \"12 hours\"\n ERROR: The expression will never reach the final date with the given period\n\n\nMaking the period a negative value will make the above expression work as\nexpected::\n\n C:\\> timerange.exe -s \"tomorrow\" -e \"yesterday\" -p \"-12 hours\"\n 2012-01-30 11:29:04\n 2012-01-29 23:29:04\n 2012-01-29 11:29:04\n 2012-01-28 23:29:04\n 2012-01-28 11:29:04\n\n\nDevelopment and bug reports\n===========================\n\nThe latest version of the script can be obtained from `timerange website`_.\nPlease report any bugs or recommendations for improvements to the author.\n\n\nLicense\n=======\n\nThe script is licensed under GNU General Public License version 3 or later\n(GPLv3_).\n\n\n.. _py2exe: http://www.py2exe.org/\n\n.. _GPLv3: http://www.gnu.org/copyleft/gpl.html\n\n.. _`timerange website`: https://bitbucket.org/todor/timerange", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/todor/timerange", "keywords": null, "license": "GNU General Public License (GPL)", "maintainer": null, "maintainer_email": null, "name": "timerange", "package_url": "https://pypi.org/project/timerange/", "platform": "any", "project_url": "https://pypi.org/project/timerange/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://bitbucket.org/todor/timerange" }, "release_url": "https://pypi.org/project/timerange/1.07/", "requires_dist": null, "requires_python": null, "summary": "Generates list of dates in various formats", "version": "1.07" }, "last_serial": 800695, "releases": { "1.07": [ { "comment_text": "", "digests": { "md5": "f78d8a99c0269a3abadcd8258a2df6fa", "sha256": "4bcb8d2ed2133eba2b508c93ca426568f8210651f1f4ef857d9615d678b3ba15" }, "downloads": -1, "filename": "timerange-1.07.zip", "has_sig": false, "md5_digest": "f78d8a99c0269a3abadcd8258a2df6fa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13650, "upload_time": "2012-01-30T15:54:14", "url": "https://files.pythonhosted.org/packages/01/29/e98c4e2eac33bac738df70872cfe2566b4f47b2c302ff381e857aadd5089/timerange-1.07.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f78d8a99c0269a3abadcd8258a2df6fa", "sha256": "4bcb8d2ed2133eba2b508c93ca426568f8210651f1f4ef857d9615d678b3ba15" }, "downloads": -1, "filename": "timerange-1.07.zip", "has_sig": false, "md5_digest": "f78d8a99c0269a3abadcd8258a2df6fa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13650, "upload_time": "2012-01-30T15:54:14", "url": "https://files.pythonhosted.org/packages/01/29/e98c4e2eac33bac738df70872cfe2566b4f47b2c302ff381e857aadd5089/timerange-1.07.zip" } ] }