{ "info": { "author": "Isaac To", "author_email": "isaac.to@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries" ], "description": "# Date command: A command-based date computation engine\n\ndatec allows you to use \"date commands\" to modify datetime's by adding\nto them, like datetime.datetime.now() + Period(2, 'week').\n\nA date command can be parsed from string using the parse() function,\nwhich create a command from a string representation. This forms the\nbasis of the datec command, which is a command-line program to output\ndatetime after applying date commands. In general the date\nrepresentation is NxYYYY-mm-ddTHH:MM:SS.ffffff, where unspecified\nparts are omitted leaving the symbols intact, like \"2x-2-29T3::.\" (see\nthe following for the meaning). If fractional part is not specified\nthe \".\" may be omitted, if all time parts are not specified the \"T::.\"\ncan be omitted, if all date parts are not specified the \"--T\" can be\nomitted, and if N is 0 the x may be omitted. By there are a couple\nother more formats like +3week and -2wed for shifting by period and\nweekday.\n\nDate commands are in two forms: period shifting commands and partial\ndatetime shifting commands. The first type is more familiar: they\nlook like\n\n * +2week (shift the datetime forward by 2 week)\n * -1month (shift the datetime backward by 1 month)\n\nPeriod is one of year, month, week, day, hour, minute and second,\nrepresented by an object of the Period class. Fractional numbers are\nacceptable except for year and month. If shifting a period leads to\nan invalid date (e.g., shift backward 1 month from 2019-07-31), it\nmoves backwards the closest valid date (here, 2019-06-30). In general\nthe parts finer than the shifted part is unaffected (e.g., shifting 1\nmonth from 2019-07-31 02:00 gives you 2019-06-30 02:00).\n\nPartial datetime shifting is less familiar. It looks like:\n\n * 12:: (set the hour number to 12)\n * +2x12:: (move forward to the second hour 12)\n * +4x--31 (move forward to the fourth occurrence of day 31 of a month)\n * -3x-02-29 (move backward to the third occurrence of February 29)\n * wed (set to the Wednesday of the same week, week starts on Sunday)\n * -3wed (move to the third Wednesday before the current datetime)\n\nThey are represented by either a Weekday object or a PartialDate\nobject with a count. A count of 0 means setting instead of shifting.\nOnly integer counts are acceptable.\n\nIt is an error to set to an invalid date (e.g., --31 applied on\n2019-06-25 is an error). The datetime parts which are specified must\nbe consecutive (it is an error to specify 12::05). It is also an\nerror to shift for occurrence of partial date with year specified\n(e.g., \"+2x2019--\").\n\nOn the other hand, shifting to an invalid date with day number\nspecified will shift more until a specified date is valid. For\nexample, if you add -2-29 with count 1 to 2019-01-01, you end up with\n2020-02-29, because 2019-02-29 is not a valid date. If the count is 2\nyou get 2024-02-29 instead.\n\nShifting to invalid date by month will cause the date to moved\nbackwards until the date is valid. E.g., if you shift by -6- with\ncount 1 (next June) from 2019-05-31, you get 2019-06-30. With count 2\nyou get 2020-06-30.\n\nThis library is grown out of frustration that it is tedious to have a\nshell script or program to get a datetime like \"the next 6pm from now\"\nor \"the next 3rd of any month from two days ago\". With this module\nthey can be specified like \"+1x18:00:00.0\" and \"-2day +1x--3\"\nrespectively. In the expected use cases, counts are small numbers.\nSo the library is not always efficient (at times we just loop \"count\"\ntimes to step forward or backward). Whenever it is simple to do so,\nthe implementation just forward to relativedelta, in which case they\nare more efficient.\n\nAt present the program does not handle timezone and daylight saving.\nThis is bacause the author lives at a place where no daylight saving\nis observed. Contributions are welcome.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/isaacto/datec", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "datec-isaacto", "package_url": "https://pypi.org/project/datec-isaacto/", "platform": "", "project_url": "https://pypi.org/project/datec-isaacto/", "project_urls": { "Homepage": "https://github.com/isaacto/datec" }, "release_url": "https://pypi.org/project/datec-isaacto/0.1.1/", "requires_dist": [ "python-dateutil" ], "requires_python": "", "summary": "Date Command", "version": "0.1.1" }, "last_serial": 5567926, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "606440a3b049f6ad79204c0c9072aedc", "sha256": "e492a62fb8609e260742824b7c329010f967c9312cb51f5ec54a9899dff4021a" }, "downloads": -1, "filename": "datec_isaacto-0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "606440a3b049f6ad79204c0c9072aedc", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9579, "upload_time": "2019-07-22T14:49:12", "url": "https://files.pythonhosted.org/packages/12/a0/4945814b5fbe5748d08dac018db2a7b66350d3144614702a9d7bb7a139c6/datec_isaacto-0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b688cc27ae358260e038f59b562ff41b", "sha256": "31916b05e701e82516eafa92eace2094827c1b1b097fb87f00039119f0179688" }, "downloads": -1, "filename": "datec-isaacto-0.1.tar.gz", "has_sig": false, "md5_digest": "b688cc27ae358260e038f59b562ff41b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6644, "upload_time": "2019-07-22T14:49:14", "url": "https://files.pythonhosted.org/packages/3d/29/609aae8880c951421f4a38dc3b79bf07331e6b5da8573d813279b79b33b0/datec-isaacto-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "c17d29e12b5b1ca4af9291675ec8f3d7", "sha256": "e68686b90b10bf964c1271e3ccf37d61f394a40a92a88d0584372ca27c8a5dde" }, "downloads": -1, "filename": "datec_isaacto-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c17d29e12b5b1ca4af9291675ec8f3d7", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9618, "upload_time": "2019-07-22T15:11:57", "url": "https://files.pythonhosted.org/packages/f5/81/594e23b8120a8c4ac4ef7c81503576d3d488ef34510aa11cdba9eb7c9e37/datec_isaacto-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "71fac62184674ac377104e868956e438", "sha256": "c68b2e8efc082d6091b48893d6bf89a5bdf0f39144eb99754929cac4707ebc98" }, "downloads": -1, "filename": "datec-isaacto-0.1.1.tar.gz", "has_sig": false, "md5_digest": "71fac62184674ac377104e868956e438", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7231, "upload_time": "2019-07-22T15:12:00", "url": "https://files.pythonhosted.org/packages/53/b8/f8fa8c885272b42926c54ec0586d36d38044f7287497ffe060fc0e2e4b7c/datec-isaacto-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c17d29e12b5b1ca4af9291675ec8f3d7", "sha256": "e68686b90b10bf964c1271e3ccf37d61f394a40a92a88d0584372ca27c8a5dde" }, "downloads": -1, "filename": "datec_isaacto-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c17d29e12b5b1ca4af9291675ec8f3d7", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9618, "upload_time": "2019-07-22T15:11:57", "url": "https://files.pythonhosted.org/packages/f5/81/594e23b8120a8c4ac4ef7c81503576d3d488ef34510aa11cdba9eb7c9e37/datec_isaacto-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "71fac62184674ac377104e868956e438", "sha256": "c68b2e8efc082d6091b48893d6bf89a5bdf0f39144eb99754929cac4707ebc98" }, "downloads": -1, "filename": "datec-isaacto-0.1.1.tar.gz", "has_sig": false, "md5_digest": "71fac62184674ac377104e868956e438", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7231, "upload_time": "2019-07-22T15:12:00", "url": "https://files.pythonhosted.org/packages/53/b8/f8fa8c885272b42926c54ec0586d36d38044f7287497ffe060fc0e2e4b7c/datec-isaacto-0.1.1.tar.gz" } ] }