{ "info": { "author": "Tim Savannah", "author_email": "kata198@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "License :: OSI Approved :: GNU Lesser General Public License v2 (LGPLv2)", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5" ], "description": "text2datetime\n=============\nPython module which can convert an extensive number of ways to represent time with strings to datetime objects\n\nSome examples include:\n\n\"Tomorrow 5:00AM\" - for tomorrow at 5am\n\n\"+3yr +2d\" - For three years and two days in future\n\n\"-5mo 16:00\" - For 5 months ago at 16:00 hours (4PM)\n\n\"1/8/2015\" - Depending on monthBeforeDate flag, could be Jan 8th or August 1st, 2015.\n\n\n\nThe primary function which supports converting all of these various texts is *text2datetime.text2datetime*\n\n**text2datetime method**\n\n\n\tdef text2datetime(timeStr, now=None, monthBeforeDay=True):\n\n\ntimeStr - The text to convert to a datetime.datetime object\n\nnow - Defaults to now, but you can calculate relative to a different date if you provide a datetime.datetime here\n\nmonthBeforeDay - For relevant formats, True will have the expected format be month-before-day (American format), False will have day before month (European format).\n\n\n**Other Methods**\n\nWhile text2datetime supports interpreting all known forms of date and time strings, there are individual public methods for each form you may also use.\n\nSee http://htmlpreview.github.io/?https://github.com/kata198/text2datetime/blob/master/doc/text2datetime.html for pydoc of all methods.\n\n\nSupported Formats\n-----------------\n\n\nDate should be in one of the following forms:\n\n - *Relative Modifiers*\n\n\tRelative modifiers represent a delta from current time, current date.\n\n\n\tEach modifier starts with a direction (+ or -), then a number, then a unit.\n\n\n\tExample: +3d means '3 days from this very second'\n\n\n\tAvailable modifiers:\n\n\n\t\ty = years\n\n\t\tyr = years\n\n\t\tmo = months\n\n\t\td = days\n\n\t\th = hours\n\n\t\tm = minutes\n\n\t\ts = seconds\n\n\n\tYou may use relative modifiers and have a final entry be a fixed time,\n\n\tfor example \"+3d 12:00:00\" would be noon three days from now.\n\n\n - *Fixed String*\n\n\tOne of the following fixed strings:\n\n\n\t\t\"now\" - Right now (to the second)\n\n\t\t\"today\" - Beginning of today (00:00:00)\n\n\t\t\"tomorrow\" - Beginning of tomorrow\n\n\t\t\"yesterday\" - Beginning of yesterday\n\n\n\tCan optionally be followed with a time, as hour:minute or hour:minute:second, otherwise midnight (00:00:00) is used. Clock is 24-hour clock, 00=midnight, unless \"PM\" or \"AM\" is at the end.\n\n\n\tExample: \"tomorrow 5:00PM\"\n\n\n - *ctime format*\n\n\n\tCtime format with optional day of week\n\n\n\t\t(3-letter-day) [3-letter-month] [2-digit date] [2-hour]:[2-minute]:[2-second] [4-digit Year]\n\n\n\tExample: Wed Jan 28 12:28:13 2015\n\n\n - *American Date Format*\n\n\n\tnumeric Month/Day/Year with optional time as hour:minute or hour:minute:second. Clock is a 24-hour clock, 00=midnight, unless \"PM\" or \"AM\" is at the end.\n\n\n\te.x.: 1/28/2015 or 1/28/2015 12:28:13\n\n\n\tThis is used when monthBeforeDay=True (default) in text2datetime, getDatetimeFromDateStr when monthBeforeDay=True, and getDatetimeFromAmericanTime\n\n\n - *European Date Format*\n\n\n\tnumeric Day/Month/Year with optional time as hour:minute or hour:minute:second. Clock is a 24-hour clock, 00=midnight, unless \"PM\" or \"AM\" is at the end.\n\n\n\te.x.: 28/1/2015 or 28/1/2015 12:28:13\n\n\n\tThis is used when monthBeforeDay=False in text2datetime, getDatetimeFromDateStr when monthBeforeDay=False, and getDatetimeFromEuropeanTime\n\n\n - *Time Only*\n\n\n\ttime as hour:minute or hour:minute:second will use current date. Clock is a 24 hour clock, 00=midnight, unless \"PM\" or \"AM\" is at the end.\n\n\n**NOTES:**\n\n\n\tUnless AM/PM is specified in formats that support it, hours are in 24-hour clock format, starting with 00=midnight, 23 = 11PM", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/kata198/text2datetime", "keywords": "text2datetime,text,string,time,conversion,datetime,tomorrow,relative,date,convert", "license": "LGPLv2", "maintainer": null, "maintainer_email": null, "name": "text2datetime", "package_url": "https://pypi.org/project/text2datetime/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/text2datetime/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/kata198/text2datetime" }, "release_url": "https://pypi.org/project/text2datetime/1.0.1/", "requires_dist": null, "requires_python": null, "summary": "Python module which can convert an extensive number of ways to represent time with strings to datetime objects", "version": "1.0.1" }, "last_serial": 1952305, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "3b5344593db94543bb943c3788460ae6", "sha256": "c9e37ff20c817d70774c7f3697decd380a697a06309837d9f27338467d272719" }, "downloads": -1, "filename": "text2datetime-1.0.0.tar.gz", "has_sig": false, "md5_digest": "3b5344593db94543bb943c3788460ae6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18684, "upload_time": "2016-02-12T03:10:59", "url": "https://files.pythonhosted.org/packages/86/f5/4a15bd1dedbceac6554d04a14cf31e495cfab5bbb92040cad2cf2589929e/text2datetime-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "e02f16180eb079ff1bf9702a02add755", "sha256": "5b826d97ad102106d04fa8324b56806478792cf5d0af98288eff83378d625105" }, "downloads": -1, "filename": "text2datetime-1.0.1.tar.gz", "has_sig": false, "md5_digest": "e02f16180eb079ff1bf9702a02add755", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19527, "upload_time": "2016-02-12T03:53:42", "url": "https://files.pythonhosted.org/packages/45/36/927c0c47dcc9a9aa525a5d009b2948ba7ea1f21ee06a74399f89dbbf82b3/text2datetime-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e02f16180eb079ff1bf9702a02add755", "sha256": "5b826d97ad102106d04fa8324b56806478792cf5d0af98288eff83378d625105" }, "downloads": -1, "filename": "text2datetime-1.0.1.tar.gz", "has_sig": false, "md5_digest": "e02f16180eb079ff1bf9702a02add755", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19527, "upload_time": "2016-02-12T03:53:42", "url": "https://files.pythonhosted.org/packages/45/36/927c0c47dcc9a9aa525a5d009b2948ba7ea1f21ee06a74399f89dbbf82b3/text2datetime-1.0.1.tar.gz" } ] }