{ "info": { "author": "Sinux", "author_email": "nsinux@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "PyTime\n======\n\n|Build Status| |PyPI version| |Supported Python versions|\n\nPyTime is a easy-use Python module which aims to operate\ndate/time/datetime by string.\n\nPyTime allows you using nonregular datetime string to generate and\ncalculate datetime at most situation.\n\nIt Also provides you some simple useful methods for getting datetime you\nwant.\n\nInstall\n-------\n\n.. code:: python\n\n pip install pytime\n\nSample Usage\n------------\n\nCalculate ``datetime`` all by string, accept unit for short or overall\nlength, support out of order or in capital unit:\n\n.. code:: python\n\n >>>from pytime import pytime\n >>>\n >>>pytime.before('2015.5.17', '2years 3mon 23week 3d 2hr') # 2years 3monhts 23weeks 3days 2hours before 2015.5.17\n datetime.datetime(2012, 9, 5, 22, 0)\n >>>\n >>>pytime.after(pytime.tomorrow('15.5.17'), '23month3dy29minu') # 23months 3days 29minutes after 2015-5-17's next day\n datetime.datetime(2017, 4, 21, 0, 29)\n\nParse nonregular datetime string to datetime:\n\n.. code:: python\n\n >>>pytime.parse('April 3rd 2015')\n datetime.date(2015, 4, 3)\n >>>pytime.parse('Oct, 1st. 2015')\n datetime.date(2015, 10, 1)\n >>>pytime.parse('NOV21th2015')\n datetime.date(2015, 11, 21)\n >>>\n >>>pytime.parse('2015517')\n datetime.date(2015, 5, 17)\n >>>\n >>>pytime.parse('5/17/15')\n datetime.date(2015, 5, 17)\n >>>\n >>>pytime.parse('92-11-2')\n datetime.date(1992, 11, 2)\n >>>\n >>>pytime.parse(1432310400) # support datetimestamp for all function\n datetime.datetime(2015, 5, 23, 0, 0)\n\nCalculate week and month in a easy way. Normally we want to use these\nbinate date in script, from Monday to next Monday which means\n00:00:00-23:59:59, and Month from 1st to next 1st in the same way, but\nif you want clean date interval, you could set\n``pytime.next_week(clean=True)`` to get the clean date for next week\netc.\n\n.. code:: python\n\n >>>pytime.this_week()\n (datetime.date(2015, 5, 11), datetime.date(2015, 5, 18))\n\n >>>pytime.next_week('2015-6-14') # 2015-6-14's next week for script\n (datetime.date(2015, 6, 15), datetime.date(2015, 6, 23))\n\n >>>pytime.last_week(pytime.mother(2013), True) # 2013 Mother's Day's last week\n (datetime.date(2013, 5, 13), datetime.date(2013, 5, 20))\n\n >>>pytime.next_month('2015-10-1')\n (datetime.date(2015, 11, 1), datetime.date(2015, 12, 1))\n\nPytime support calculate timedelta by string even between ``date`` and\n``datetime``, merely set the ``date`` to that day's midnight:\n\n.. code:: python\n\n >>>pytime.count('2015-5-17 23:23:23', pytime.tomorrow())\n datetime.timedelta(1, 84203)\n\nGet common festivals for designated year:\n\n.. code:: python\n\n >>>pytime.father() # Father's Day\n datetime.date(2015, 6, 21)\n >>>\n >>>pytime.mother(2016) # 2016 Mother's Day\n datetime.date(2016, 5, 8)\n >>>\n >>>pytime.easter(1999) # 1999 Easter\n datetime.date(1999, 4, 4)\n\nGet days between two date.\n\n.. code:: python\n\n >>>pytime.daysrange('2015-5-17', '2015-5-23')\n [datetime.date(2015, 5, 23),\n datetime.date(2015, 5, 22),\n datetime.date(2015, 5, 21),\n datetime.date(2015, 5, 20),\n datetime.date(2015, 5, 19),\n datetime.date(2015, 5, 18),\n datetime.date(2015, 5, 17)]\n\n...\n\nand other useful methods.\n\nContributors\n------------\n\n- Sinux\n- `felipevolpone `__\n- `fy `__\n- `Joshua Dong `__\n\nLicense\n-------\n\nMIT\n\n.. |Build Status| image:: https://travis-ci.org/shinux/PyTime.svg?branch=master\n :target: https://travis-ci.org/shinux/PyTime\n.. |PyPI version| image:: https://badge.fury.io/py/pytime.svg\n :target: http://badge.fury.io/py/pytime\n.. |Supported Python versions| image:: https://img.shields.io/pypi/pyversions/PyTime.svg\n :target: https://pypi.python.org/pypi/pytime/", "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/shinux/PyTime", "keywords": "datetime time datetime timeparser", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "pytime", "package_url": "https://pypi.org/project/pytime/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pytime/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/shinux/PyTime" }, "release_url": "https://pypi.org/project/pytime/0.2.0/", "requires_dist": null, "requires_python": null, "summary": "A easy-use module to operate datetime by string", "version": "0.2.0" }, "last_serial": 2290630, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "4d7c3c36ba687dd968af509ada6d9109", "sha256": "3323f115082b58dba7c7d8ac1c4343055cb813d8ceb5248993ce176be426574d" }, "downloads": -1, "filename": "pytime-0.1.1.tar.gz", "has_sig": false, "md5_digest": "4d7c3c36ba687dd968af509ada6d9109", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6351, "upload_time": "2015-05-15T12:20:57", "url": "https://files.pythonhosted.org/packages/fe/c8/5ec73bc8d13e13e0c4e6aca9e3341b5d235278016f09826cd5ae0c78e726/pytime-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "c067d4f260244a682676f368e81c56b6", "sha256": "4f75c9f10e8aa95c10890027cdf8232de457677d1a37b9e7fe06310b4d7cbbca" }, "downloads": -1, "filename": "pytime-0.1.2.tar.gz", "has_sig": false, "md5_digest": "c067d4f260244a682676f368e81c56b6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6399, "upload_time": "2015-05-16T09:38:53", "url": "https://files.pythonhosted.org/packages/fb/21/ce5b20e901b2d45ad8ba137e13bf45f1e4c3f3bbbef7fd4a1e0ac60f4fba/pytime-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "7562b3747105aec82d050b99f7a9c4bd", "sha256": "2a088bac28468fa80705340fe9fe01b97858aaa4c27a68b7b2e9cbaee3976575" }, "downloads": -1, "filename": "pytime-0.1.3.tar.gz", "has_sig": false, "md5_digest": "7562b3747105aec82d050b99f7a9c4bd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6989, "upload_time": "2015-05-16T12:28:07", "url": "https://files.pythonhosted.org/packages/e2/50/295a9669d54df572f4d87e6efa69577eebde440972d3235ea14d21ad05bb/pytime-0.1.3.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "d53e7757657888aecf0f91fc44742735", "sha256": "c51420e7150669b662cc97f0c9c15824f18a21fda2a26029dbc28194b83ac651" }, "downloads": -1, "filename": "pytime-0.1.5.tar.gz", "has_sig": false, "md5_digest": "d53e7757657888aecf0f91fc44742735", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7161, "upload_time": "2015-05-18T01:34:24", "url": "https://files.pythonhosted.org/packages/43/14/0f8d4d60137b470c0fc2c77d9d508b897f2c6fff8f7442e0a0c573922cdd/pytime-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "29b022c612fa61cbb3854c89076779bd", "sha256": "b27b8b40c7b0c44c53a5a12442eb8198d9c3786bbe06ad6a5503bf848215f1d4" }, "downloads": -1, "filename": "pytime-0.1.6.tar.gz", "has_sig": false, "md5_digest": "29b022c612fa61cbb3854c89076779bd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7727, "upload_time": "2015-05-22T14:48:01", "url": "https://files.pythonhosted.org/packages/9d/87/4f434cefaf104c2e53ba7a40028ac112a60275d3057ceb67eb76da70de33/pytime-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "578c0a294aafff92113b6456d9853a47", "sha256": "64893040de1874c5e679be34bdd9272572cd6dff3f40c8b8f7b240c8e4755cb3" }, "downloads": -1, "filename": "pytime-0.1.7.tar.gz", "has_sig": false, "md5_digest": "578c0a294aafff92113b6456d9853a47", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7725, "upload_time": "2015-05-22T14:53:04", "url": "https://files.pythonhosted.org/packages/24/9f/b66d099ae5f271ee88b833b508b5c697c46a4dd47d36de34a98b7efa505a/pytime-0.1.7.tar.gz" } ], "0.1.8": [ { "comment_text": "", "digests": { "md5": "3c94dc7515aa07702f3a0fa97da5b994", "sha256": "e16cdf912c3065f22d635ef664b5a6bb0aca238f0381fe9ca83a944e1a7a02e5" }, "downloads": -1, "filename": "pytime-0.1.8.tar.gz", "has_sig": false, "md5_digest": "3c94dc7515aa07702f3a0fa97da5b994", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7891, "upload_time": "2015-06-20T08:41:13", "url": "https://files.pythonhosted.org/packages/3a/a9/1475248e9b73034d8e09b1fda052b341085318835f8a4234fb203f0b8365/pytime-0.1.8.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "14fd56a65558703f16753de2b3838887", "sha256": "94557f81497e62bb1ee33dbf4efefd4c2712f098a3ffe90a0abee93c0565447a" }, "downloads": -1, "filename": "pytime-0.2.0.tar.gz", "has_sig": false, "md5_digest": "14fd56a65558703f16753de2b3838887", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7753, "upload_time": "2016-08-19T10:58:52", "url": "https://files.pythonhosted.org/packages/7b/60/e0a9f646a41a5493e64760faacedc45d6916883ea4662cf81f98955bc7d3/pytime-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "14fd56a65558703f16753de2b3838887", "sha256": "94557f81497e62bb1ee33dbf4efefd4c2712f098a3ffe90a0abee93c0565447a" }, "downloads": -1, "filename": "pytime-0.2.0.tar.gz", "has_sig": false, "md5_digest": "14fd56a65558703f16753de2b3838887", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7753, "upload_time": "2016-08-19T10:58:52", "url": "https://files.pythonhosted.org/packages/7b/60/e0a9f646a41a5493e64760faacedc45d6916883ea4662cf81f98955bc7d3/pytime-0.2.0.tar.gz" } ] }