{ "info": { "author": "hustcc", "author_email": "i@hust.cc", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "Natural Language :: Chinese (Simplified)", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.5", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Utilities" ], "description": "timeago\n=======\n\nA very simple python lib, used to format datetime with ``*** time ago``\nstatement. Javascript version here. `timeago.js`_.\n\n|Build Status| |PyPi Status| |Python Versions|\n\nSuch as:\n\n::\n\n just now\n 12 seconds ago\n 3 minutes ago\n 2 hours ago\n 24 days ago\n 6 months ago\n 2 years ago\n\n in 12 seconds\n in 3 minutes\n in 2 hours\n in 24 days\n in 6 months\n in 2 years\n\nFor other languages see below.\n\nInstall\n-------\n\n.. code:: sh\n\n pip install timeago\n\n.. _usage--example:\n\nUsage & Example\n---------------\n\n.. code:: py\n\n # -*- coding: utf-8 -*-\n import timeago, datetime\n\n now = datetime.datetime.now() + datetime.timedelta(seconds = 60 * 3.4)\n\n date = datetime.datetime.now()\n\n # locale\n print (timeago.format(date, now, 'zh_CN')) # will print `3\u5206\u949f\u524d`\n\n # input datetime\n print (timeago.format(date, now)) # will print 3 minutes ago\n\n # input timedelta\n print (timeago.format(datetime.timedelta(seconds = 60 * 3.4))) # will print 3 minutes ago\n\n # input date, auto add time(0, 0, 0)\n print (timeago.format(datetime.date(2016, 5, 27), now))\n\n # input datetime formated string\n print (timeago.format('2016-05-27 12:12:03', '2016-05-27 12:12:12')) # will print just now\n\n # inverse two parameters\n print (timeago.format('2016-05-27 12:12:12', '2016-05-27 12:12:03')) # will print a while\n\n.. _method--parameter:\n\nMethod & Parameter\n------------------\n\nonly one API ``format``.\n\nThree parameters of method ``format``:\n\n- ``date``: the parameter which will be formated, must be instance\n of ``datetime`` / ``timedelta`` or datetime formated string.\n- ``now``: reference time, must be instance of ``datetime`` or\n datetime formated string.\n- ``locale``: the locale code, default ``en``.\n\nLocale\n------\n\nAt the time we're speaking, `following locale`_ are available:\n\n- ``bg``\n- ``ca``\n- ``da``\n- ``de``\n- ``el``\n- ``en``\n- ``en_short``\n- ``es``\n- ``eu``\n- ``fa_IR``\n- ``fi``\n- ``fr``\n- ``gl``\n- ``he``\n- ``hu``\n- ``in_BG``\n- ``in_HI``\n- ``in_ID``\n- ``it``\n- ``ja``\n- ``ko``\n- ``ml``\n- ``my``\n- ``nb_NO``\n- ``nl``\n- ``nn_NO``\n- ``pl``\n- ``pt_BR``\n- ``ru``\n- ``sv_SE``\n- ``ta``\n- ``th``\n- ``tr``\n- ``vi``\n- ``zh_CN``\n- ``zh_TW``\n\nLocalization\n------------\n\n1. Fork the project\n2. Create a locale python script called ``[name_of_your_locale].py``\n following the existing other locales.\n3. Add the name of your locale in the Readme to keep it updated\n (**alphabetically**).\n4. Add test case following the `english model`_\n5. Create the Pull Request.\n\nNotes\n~~~~~\n\nFor complicated plurals, you can take example on the PL (Polish) locale\n`here`_\n\n.. _timeago.js: https://github.com/hustcc/timeago.js\n.. _following locale: https://github.com/hustcc/timeago/tree/master/src/timeago/locales\n.. _english model: https://github.com/hustcc/timeago/tree/master/test/testcase.py#L50\n.. _here: https://github.com/hustcc/timeago/tree/master/src/timeago/locales/pl.py\n\n.. |Build Status| image:: https://travis-ci.org/hustcc/timeago.svg?branch=master\n :target: https://travis-ci.org/hustcc/timeago\n.. |PyPi Status| image:: https://img.shields.io/pypi/v/timeago.svg\n :target: https://pypi.python.org/pypi/timeago\n.. |Python Versions| image:: https://img.shields.io/pypi/pyversions/timeago.svg\n :target: https://pypi.python.org/pypi/timeago\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/hustcc/timeago", "keywords": "timeago,seconds ago,minutes ago,hours ago,just now", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "timeago", "package_url": "https://pypi.org/project/timeago/", "platform": "", "project_url": "https://pypi.org/project/timeago/", "project_urls": { "Homepage": "https://github.com/hustcc/timeago" }, "release_url": "https://pypi.org/project/timeago/1.0.10/", "requires_dist": null, "requires_python": "", "summary": "A very simple python library, used to format datetime with `*** time ago` statement. eg: \"3 hours ago\".", "version": "1.0.10" }, "last_serial": 5122866, "releases": { "1.0.10": [ { "comment_text": "", "digests": { "md5": "1b3ed26c741a663c863a04df1c23cb13", "sha256": "67cee34d6c4210a0213432c9e1a96f06209d7552090c86d31653ca0ec9443ef3" }, "downloads": -1, "filename": "timeago-1.0.10-py3-none-any.whl", "has_sig": false, "md5_digest": "1b3ed26c741a663c863a04df1c23cb13", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 25218, "upload_time": "2019-04-10T08:37:09", "url": "https://files.pythonhosted.org/packages/30/18/8e9e4b5671d246deb6b7f1ab481404f08cf082fccd08ac5870522eb5dcc2/timeago-1.0.10-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "225d8f5e1099f39eac12ff8d5a768d84", "sha256": "1e26ed34cc1fdcdbb949a0d9603a78d9b794ec1ec2a6179a13466596cbdc2320" }, "downloads": -1, "filename": "timeago-1.0.10.tar.gz", "has_sig": false, "md5_digest": "225d8f5e1099f39eac12ff8d5a768d84", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22725, "upload_time": "2019-04-10T08:37:10", "url": "https://files.pythonhosted.org/packages/02/1f/8a5a6eff81c46a36935374aca2abf27887f2bc22934f2e9ddc2aa5b3b184/timeago-1.0.10.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "8d34948eca5e3d7c47661137843eda67", "sha256": "c3c54502cfdd1023ec7ebc4032e0802cdbed186da041320d81c3f93a28fa3396" }, "downloads": -1, "filename": "timeago-1.0.3.zip", "has_sig": false, "md5_digest": "8d34948eca5e3d7c47661137843eda67", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8107, "upload_time": "2016-05-27T15:44:50", "url": "https://files.pythonhosted.org/packages/88/4b/acb1b76b94fd22877a39c5c77bf6806e62ef25de0d326ac396e7e6fd2953/timeago-1.0.3.zip" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "1bc90e8e47442f6d66ec150e20ba9076", "sha256": "5d1431636fa5128b7b3c93f119f4d643c19f04551d62c3162020cbbcde5d7aef" }, "downloads": -1, "filename": "timeago-1.0.4.zip", "has_sig": false, "md5_digest": "1bc90e8e47442f6d66ec150e20ba9076", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8888, "upload_time": "2016-07-11T11:02:32", "url": "https://files.pythonhosted.org/packages/ff/e4/b4653c5cc2a895484664f050d85f18fda4dec36679f1b152df46b4482f6b/timeago-1.0.4.zip" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "fc56b327907b57891e1197fae312c859", "sha256": "184384f92597938a8e869a312c454c09a1dbfc461740bde3a615e4b3515cad18" }, "downloads": -1, "filename": "timeago-1.0.5.zip", "has_sig": false, "md5_digest": "fc56b327907b57891e1197fae312c859", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8827, "upload_time": "2016-07-11T11:10:35", "url": "https://files.pythonhosted.org/packages/13/bd/84d6e966bc2f8aaa37fe3be27efab41ed469d884a27e016cd99615e595bf/timeago-1.0.5.zip" } ], "1.0.6": [ { "comment_text": "", "digests": { "md5": "65f3e507028ceb579434b3eebf3dd649", "sha256": "e8dd6f0fddcbb260d39a5094a35272ea2cf02dafee87eaaec5efac47d594540e" }, "downloads": -1, "filename": "timeago-1.0.6.zip", "has_sig": false, "md5_digest": "65f3e507028ceb579434b3eebf3dd649", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8568, "upload_time": "2016-08-30T11:46:51", "url": "https://files.pythonhosted.org/packages/e5/fa/2f4eb23ed1c0b0596ef8b69f31d8e2ec6bcfa2fa4ab54698e7179559a208/timeago-1.0.6.zip" } ], "1.0.7": [ { "comment_text": "", "digests": { "md5": "a18d105580aafafd176cee8eef4b1feb", "sha256": "c42a215088c7258b4f8b11f1809d450b2502ca121e4f83bb98e4652673b4bf0d" }, "downloads": -1, "filename": "timeago-1.0.7.zip", "has_sig": false, "md5_digest": "a18d105580aafafd176cee8eef4b1feb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10599, "upload_time": "2017-02-06T12:06:48", "url": "https://files.pythonhosted.org/packages/76/7c/0913de8863c7a1dc6ee90c650b4c73a43eaa199e516602c8e3b5f9a62e03/timeago-1.0.7.zip" } ], "1.0.8": [ { "comment_text": "", "digests": { "md5": "f31e39bfffddb1567f9f3384dc548d48", "sha256": "f2acf144a9aabbc1e46a7f84387e6dd17bf41ff5fd87822c878621d06ef6b77c" }, "downloads": -1, "filename": "timeago-1.0.8-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f31e39bfffddb1567f9f3384dc548d48", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 23369, "upload_time": "2017-12-11T17:45:47", "url": "https://files.pythonhosted.org/packages/fe/86/e457e71a4dfcb40d2256f11937df5cbaa5c4c1da55b2210933964293991d/timeago-1.0.8-py2.py3-none-any.whl" } ], "1.0.9": [ { "comment_text": "", "digests": { "md5": "312f85f0c6cc8ee77f0d9b54a394094e", "sha256": "0083424daba1ba4794143154286a5a492e160f62471c3f02d7b1b64f988e02df" }, "downloads": -1, "filename": "timeago-1.0.9-py3-none-any.whl", "has_sig": false, "md5_digest": "312f85f0c6cc8ee77f0d9b54a394094e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 24841, "upload_time": "2019-02-01T08:55:16", "url": "https://files.pythonhosted.org/packages/80/69/66e4b948c3408c977f9354867ffb6d21c7daee368c9a3053a1b9a5354334/timeago-1.0.9-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9151a0a620ed0d7361477202384b0aae", "sha256": "5473b95e6232c902b0390f0e44375863f9359432711dbcbbd15033612dc44f8a" }, "downloads": -1, "filename": "timeago-1.0.9.tar.gz", "has_sig": false, "md5_digest": "9151a0a620ed0d7361477202384b0aae", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22178, "upload_time": "2019-02-01T08:55:17", "url": "https://files.pythonhosted.org/packages/e0/e2/ed3d7252c1507073d37779fd10a7a19fbfab8368371cb521bc1fda07eae9/timeago-1.0.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1b3ed26c741a663c863a04df1c23cb13", "sha256": "67cee34d6c4210a0213432c9e1a96f06209d7552090c86d31653ca0ec9443ef3" }, "downloads": -1, "filename": "timeago-1.0.10-py3-none-any.whl", "has_sig": false, "md5_digest": "1b3ed26c741a663c863a04df1c23cb13", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 25218, "upload_time": "2019-04-10T08:37:09", "url": "https://files.pythonhosted.org/packages/30/18/8e9e4b5671d246deb6b7f1ab481404f08cf082fccd08ac5870522eb5dcc2/timeago-1.0.10-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "225d8f5e1099f39eac12ff8d5a768d84", "sha256": "1e26ed34cc1fdcdbb949a0d9603a78d9b794ec1ec2a6179a13466596cbdc2320" }, "downloads": -1, "filename": "timeago-1.0.10.tar.gz", "has_sig": false, "md5_digest": "225d8f5e1099f39eac12ff8d5a768d84", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22725, "upload_time": "2019-04-10T08:37:10", "url": "https://files.pythonhosted.org/packages/02/1f/8a5a6eff81c46a36935374aca2abf27887f2bc22934f2e9ddc2aa5b3b184/timeago-1.0.10.tar.gz" } ] }