{ "info": { "author": "qx3501332", "author_email": "x.qiu@qq.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# fdate\n\nFormats date string as 'yyyy-mm-dd' and manipulates date strings.\n\nInstallation\n---------------\n\nUse one of the following method:\n\n* pip install\n```bash\npip --install fdate\npip --install fdate --upgrade\n```\n* clone repository and install with:\n```\npython setup.py install\n``` \nUsage\n-------\n\n* Initializations\n\nFrom a string of format 'yyyy-mm-dd', where the separator '-' can be any non-digital character.\n```python\n>>> from fdate import *\n>>> fd = Fdate('2018/4/7')\n>>> fd\n'2018-04-07'\n>>> fd = Fdate('2018-4-7')\n>>> fd\n'2018-04-07'\n``` \nFrom exactly 8-length digits or Fdate object.\n```python\n>>> fd = Fdate('20180407')\n>>> fd\n'2018-04-07'\n>>> fe = Fdate(fd)\n>>> fe\n'2018-04-07'\n```\n\nFrom unix timestamp, with default time unit: second.\n```python\n>>> fd = Fdate().from_timestamp(1523030400)\n>>> fd\n'2018-04-07'\n```\n\nIn case time unit is not second, say minisecond, set `unit=1000`.\n```python\n>>> fd = Fdate().from_timestamp(1523030400000, unit=1000)\n>>> fd\n'2018-04-07'\n```\n\nFrom function `today(shift=0)`\n```python\n>>> fd = today() # today\n>>> fd = today(-1) # yesterday\n>>> fd = today(1) # tomorrow\n```\n\n* Properties\n```python\n>>> fd = Fdate('20180407')\n>>> fd.year, fd. month, fd.day\n(2018, 4, 7)\n>>> fd.rank # 2018-04-07 is the 97th day of the year.\n97\n>>> fd.is_weekend\nTrue\n>>> fd.is_workday\nFalse\n>>> fd.is_leap_year\nFalse\n>>> fd.is_first_day(of='M') # first day of the ... ? 'M' -- month (default), 'Y' -- year\nFalse\n>>> Fdate('2018-3-31').is_last_day()\nTrue\n>>> fd.to_timestamp() # to unix timestamp\n1523030400\n``` \n\n* Calculations\n\n```python\n>>> fd = Fdate('20180407')\n>>> fd + 1\n'2018-04-08'\n>>> fd -= 1\n>>> fd\n'2018-04-06'\n>>> fd - '2018.3.6'\n31\n>>> fd - '2018/5/6'\n-30\n>>> fd > '2018-3-6'\nTrue\n>>> fd == '2018.4.6'\nTrue\n```\n\n* Iterations\n\n```python\n>>> [x for x in drange('2018-03-30', '2018-04-03')]\n['2018-03-30', '2018-03-31', '2018-04-01', '2018-04-02', '2018-04-03']\n>>> [x for x in drange('2018-04-03', '2018-03-30')]\n['2018-04-03', '2018-04-02', '2018-04-01', '2018-03-31', '2018-03-30']\n```\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/nullgo/fdate", "keywords": "", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "fdate", "package_url": "https://pypi.org/project/fdate/", "platform": "", "project_url": "https://pypi.org/project/fdate/", "project_urls": { "Homepage": "https://github.com/nullgo/fdate" }, "release_url": "https://pypi.org/project/fdate/0.1.7/", "requires_dist": null, "requires_python": "", "summary": "Formats date string as 'yyyy-mm-dd' and manipulates dates.", "version": "0.1.7" }, "last_serial": 4848208, "releases": { "0.1.3": [ { "comment_text": "", "digests": { "md5": "44e298dcaa6889d6a28f83fca5265b4d", "sha256": "e471cb6d06408b3c0c54cd779b9d611a08b82464e1672b270a77f13af6b40b5d" }, "downloads": -1, "filename": "fdate-0.1.3.tar.gz", "has_sig": false, "md5_digest": "44e298dcaa6889d6a28f83fca5265b4d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3951, "upload_time": "2018-04-07T10:26:37", "url": "https://files.pythonhosted.org/packages/db/7f/f9ee6d9c3a3f793951615f976320f03d4e961d914217d7c6ff4ff158ff94/fdate-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "1fe70a7a008fd1aca67a10b1363e8c69", "sha256": "be2be45d286940802b95d31733a046ea1753f4d3a25e08e301cf16abb03d78dd" }, "downloads": -1, "filename": "fdate-0.1.4.tar.gz", "has_sig": false, "md5_digest": "1fe70a7a008fd1aca67a10b1363e8c69", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3964, "upload_time": "2018-04-14T07:56:12", "url": "https://files.pythonhosted.org/packages/80/3b/27a0664268d5f7f91f834396b87f6e0c8baec142d949fc612e19c96b52ae/fdate-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "fe77cbf451a1c8c33f7bcc5197535577", "sha256": "d571f0e0ee39421eee54e5990cb54a02bd8905a122e342a7796f1ccdcd43bc54" }, "downloads": -1, "filename": "fdate-0.1.5.tar.gz", "has_sig": false, "md5_digest": "fe77cbf451a1c8c33f7bcc5197535577", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3984, "upload_time": "2018-04-14T08:59:28", "url": "https://files.pythonhosted.org/packages/3e/ab/8086c5e29bb7d25a4ad00b6aa3f934646fc51ce3b23b5b39366d06c0e89e/fdate-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "5aaead1d3024d31e1d36a26854a3b315", "sha256": "8047fa17d18f9cdd5e9096f698106a5c1ddff8159bdac7a89647286d8c377a48" }, "downloads": -1, "filename": "fdate-0.1.6.tar.gz", "has_sig": false, "md5_digest": "5aaead1d3024d31e1d36a26854a3b315", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3994, "upload_time": "2018-06-07T05:30:19", "url": "https://files.pythonhosted.org/packages/d7/28/86da56375df01269b365e9ff67f014365c0a72418f6dec6be79d2d6354ac/fdate-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "18271c254ada529d806771fc61ad27cb", "sha256": "27744714f853d85832c946c822a200f4d4fe8979804fafdb15546ee113d76ed1" }, "downloads": -1, "filename": "fdate-0.1.7-py3-none-any.whl", "has_sig": false, "md5_digest": "18271c254ada529d806771fc61ad27cb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6025, "upload_time": "2019-02-21T02:40:57", "url": "https://files.pythonhosted.org/packages/17/88/c5135eaae590de63c19cf8b184cea764ad312e913551beda218c0bf5bc18/fdate-0.1.7-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "18271c254ada529d806771fc61ad27cb", "sha256": "27744714f853d85832c946c822a200f4d4fe8979804fafdb15546ee113d76ed1" }, "downloads": -1, "filename": "fdate-0.1.7-py3-none-any.whl", "has_sig": false, "md5_digest": "18271c254ada529d806771fc61ad27cb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6025, "upload_time": "2019-02-21T02:40:57", "url": "https://files.pythonhosted.org/packages/17/88/c5135eaae590de63c19cf8b184cea764ad312e913551beda218c0bf5bc18/fdate-0.1.7-py3-none-any.whl" } ] }