{ "info": { "author": "WeiJi Hsiao", "author_email": "", "bugtrack_url": null, "classifiers": [], "description": "# DateString\n\nCreates a manipulable date string in the form of 'YYYYmmdd'.\n\n## Usage\n\n- creates date string from various inputs.\n```python\n>>> ds = DateString('20180624')\n>>> ds\n'20180624'\n\n>>> ds = DateString('2018/06/24')\n>>> ds\n'20180624'\n\n>>> ds = DateString('2018-06-24')\n>>> ds\n'20180624'\n\n>>> ds = DateString('2018\u5e746\u670824\u65e5')\n>>> ds\n'20180624'\n\n>>> ds = DateString(datetime.datetime(2018, 6, 24))\n>>> ds\n'20180624'\n\n>>> today = DateString.today()\n>>> yesterday = DateString.today(-1)\n>>> tomorrow = DateString.today(1)\n```\n\n- supports date calculation.\n```python\n>>> DateString('2018/6/24') + 90\n'20180922'\n\n>>> DateString('2018-09-22') - 90\n'20180624'\n\n>>> DateString('2018-09-22') - '2018/06/24'\n90\n\n>>> DateString('2018/9/22') - datetime.datetime(2018, 6, 24)\n90\n\n>>> DateString('20180922') - DateString('2018-6-24')\n90\n\n>>> DateString('2018\u5e749\u670822\u65e5') - pd.Timestamp('2018-06-24')\n90\n```\n\n- supports date comparison.\n```python\n>>> DateString('20180922') == '2018/9/22'\nTrue\n\n>>> DateString('20180922') == '2018/6/24'\nFalse\n\n>>> DateString('20180922') >= '2018/6/24'\nTrue\n\n>>> DateString('20180922') >= '2019/9/22'\nFalse\n```\n\n- supports date-related properties.\n```python\n>>> ds = DateString('2018-06-24')\n>>> ds.year\n2018\n>>> ds.month\n6\n>>> ds.day\n24\n>>> ds.dayofweek\n6\n>>> ds.dayofyear\n175\n>>> ds.is_leap_year\nFalse\n>>> ds.is_weekday\nFalse\n>>> ds.is_weekend\nTrue\n```\n\n- compatible with `pandas.date_range()`.\n```python\n>>> begin_ds = DateString('2019-01-01')\n>>> end_ds = DateString('2019/1/3')\n>>> pd.date_range(begin_ds, end_ds)\nDatetimeIndex(['2019-01-01', '2019-01-02', '2019-01-03'], dtype='datetime64[ns]', freq='D')\n```\n\n- supports date string reformatting.\n```python\n>>> ds = DateString('20180624')\n>>> ds.reformat()\n'2018-06-24'\n>>> ds.reformat(delimiter='/')\n'2016/06/24'\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "date-string", "package_url": "https://pypi.org/project/date-string/", "platform": "", "project_url": "https://pypi.org/project/date-string/", "project_urls": null, "release_url": "https://pypi.org/project/date-string/0.2.1/", "requires_dist": null, "requires_python": "", "summary": "Creates a manipulable date string in the form of 'YYYYmmdd'.", "version": "0.2.1" }, "last_serial": 5987360, "releases": { "0.2.1": [ { "comment_text": "", "digests": { "md5": "daeaa0d58d3ce25789ee0c3d75083634", "sha256": "644a5603fea7eaba80549480cdb198bc9b2dbf395bbfd1c259b6f83c36a8ebc8" }, "downloads": -1, "filename": "date_string-0.2.1.tar.gz", "has_sig": false, "md5_digest": "daeaa0d58d3ce25789ee0c3d75083634", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3086, "upload_time": "2019-10-17T03:15:55", "url": "https://files.pythonhosted.org/packages/c6/a3/e49d07c7bed317178cbcb3f7f9324fd35472449f5322fae3cd4256b902e3/date_string-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "daeaa0d58d3ce25789ee0c3d75083634", "sha256": "644a5603fea7eaba80549480cdb198bc9b2dbf395bbfd1c259b6f83c36a8ebc8" }, "downloads": -1, "filename": "date_string-0.2.1.tar.gz", "has_sig": false, "md5_digest": "daeaa0d58d3ce25789ee0c3d75083634", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3086, "upload_time": "2019-10-17T03:15:55", "url": "https://files.pythonhosted.org/packages/c6/a3/e49d07c7bed317178cbcb3f7f9324fd35472449f5322fae3cd4256b902e3/date_string-0.2.1.tar.gz" } ] }