{ "info": { "author": "Philip Schleihauf and Jamie Macdonald", "author_email": "uniphil@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "HumanFuture\n===========\n\nPython utility to write future dates in a human-friendly way.\n\nThe module was motivated by a need to represent future events in a friendly,\nbut not fuzzy way for the tweet-scheduling tool, \n[antictweet](http://anticitweet.com). Friendly language without sacrificing\nprecision is what makes HumanFuture different.\n\nThe module is currently hard-coded in 12-hour english, with a precision of one\nminute.\n\n\nInstalling\n==========\n\nThis packages is on PyPi, so assuming you have setup tools installed, it's just\na matter of doing\n\n pip install humanfuture\n\n\nExamples\n--------\n\n >>> import humanfuture as future\n >>> from datetime import datetime\n >>> ref = datetime(2012, 8, 6, 9, 0)\n >>> future.humanize(datetime(2012, 8, 6, 9, 1), ref)\n 'about a minute'\n >>> future.humanize(datetime(2012, 8, 6, 9, 5), ref)\n 'five minutes'\n >>> future.humanize(datetime(2012, 8, 6, 10, 30), ref)\n 'one hour and 30 minutes'\n >>> future.humanize(datetime(2012, 8, 6, 12, 0), ref)\n 'noon'\n >>> future.humanize(datetime(2012, 8, 7, 12, 0), ref)\n 'tomorrow at noon'\n >>> future.humanize(datetime(2012, 8, 7, 18, 0), ref)\n 'tomorrow at 6 pm'\n >>> future.humanize(datetime(2012, 8, 9, 14, 30), ref)\n 'Thursday at 2:30 pm'\n >>> future.humanize(datetime(2012, 8, 13, 9, 15), ref)\n 'next Monday at 9:15 am'\n >>> future.humanize(datetime(2012, 10, 13, 12, 0), ref)\n 'October 13 at noon'\n >>> future.humanize(datetime(2013, 4, 13, 23, 11), ref)\n 'April 13, 2013 at 11:11 pm'\n\n\nFor a more complete -- though, also uglier -- reference of what this module\noutputs, see `test_humanfuture.py` in `tests`.\n\n\nHumanizing Your Future\n======================\n\nThe `humanize` function in `humanfuture` is the one you want. Just pass in a\ndatetime object for sometime in the future and it should spit out a nice\nenglish string.\n\nIf you need to get out relative futures from some time other than now, you can\npass in a reference datetime as the second arguement.\n\n\nDealing with Your Past\n======================\n\nTwo exceptions could be thrown by this module, a\n`humanfuture.NegativeDeltaError`, or a `humanfuture.UnformattableError`. The\nsecond one should never actually occur. Please let me know if you ever come\nacross it. But the first one you need to watch out for.\n\nThis module's scope is restricted to future times, so it throws that\n`humanfuture.NegativeDeltaError` if you give it a futures past. To avoid this,\neither check your futures before submitting, or if you're unsure, put the\nconversion in a `try/catch` block and deal with it there.\n\n\nCredits\n=======\n\nAlthough this is a completely new module, some inspiration was taken from the\nlovely [`humanize`](https://github.com/jmoiron/humanize) module.", "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/uniphil/HumanFuture", "keywords": null, "license": "GPLv3", "maintainer": null, "maintainer_email": null, "name": "HumanFuture", "package_url": "https://pypi.org/project/HumanFuture/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/HumanFuture/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/uniphil/HumanFuture" }, "release_url": "https://pypi.org/project/HumanFuture/0.2/", "requires_dist": null, "requires_python": null, "summary": "Convert a future date to a human-friendly english format", "version": "0.2" }, "last_serial": 784515, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "738cb45f39af1a542b3423500792b6e3", "sha256": "72feb80fae3ad26b9e5608bfc88645bdba1866b8897968e72274631d84c1c6fb" }, "downloads": -1, "filename": "HumanFuture-0.1.tar.gz", "has_sig": false, "md5_digest": "738cb45f39af1a542b3423500792b6e3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1778, "upload_time": "2012-08-06T18:10:46", "url": "https://files.pythonhosted.org/packages/5f/01/32fef859098799912b3f5fe7824d6a924f66ad665a29f2633d8ac9fdce63/HumanFuture-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "baac899e4763127e980cf2a2fcbab7d2", "sha256": "7a9bf7e783451b2cd2668f792a42409cafc64988d53f333aba69a179ccd4667a" }, "downloads": -1, "filename": "HumanFuture-0.1.1.tar.gz", "has_sig": false, "md5_digest": "baac899e4763127e980cf2a2fcbab7d2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2566, "upload_time": "2012-08-06T18:41:33", "url": "https://files.pythonhosted.org/packages/7b/2b/23fc31cc1d19fd4dc7756d7f67609dd87586ddf2942894108ba5b8d595ba/HumanFuture-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "dcec53b0a2375fc41b13688dd6fb7aef", "sha256": "cd1753c7f7869bd82a58a2efc8e74c91c5ac4f35dedb6b3a61f58c7d1082f998" }, "downloads": -1, "filename": "HumanFuture-0.1.2.tar.gz", "has_sig": false, "md5_digest": "dcec53b0a2375fc41b13688dd6fb7aef", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3120, "upload_time": "2012-08-06T19:19:38", "url": "https://files.pythonhosted.org/packages/bb/06/18434d5cf2d113bdecdbd294d44213389ae8b3da6730f8b9b8a2b0add40b/HumanFuture-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "165894f4d91a05726c190efa3b9488d2", "sha256": "3a7ca87e84eb3d99967c4738f8543b6a9366823a9438424117d161d759dc0caa" }, "downloads": -1, "filename": "HumanFuture-0.1.3.tar.gz", "has_sig": false, "md5_digest": "165894f4d91a05726c190efa3b9488d2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3344, "upload_time": "2012-08-06T19:23:43", "url": "https://files.pythonhosted.org/packages/23/69/fd416b5d57e65e2a2076809b94d74c69b68c4a64c06efe4f3ad2e13553db/HumanFuture-0.1.3.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "da1440e9a54fe3aefcf6cd8fd7ebc92c", "sha256": "9396c52dd367029d2f0b7a4254f9f5ee8ba3139f0293fc60ad5104af1271f555" }, "downloads": -1, "filename": "HumanFuture-0.2.tar.gz", "has_sig": false, "md5_digest": "da1440e9a54fe3aefcf6cd8fd7ebc92c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3330, "upload_time": "2012-08-06T19:54:37", "url": "https://files.pythonhosted.org/packages/74/5e/104e069369c489d9282a89af8038d245120aa00be38f3484f97d4304e46b/HumanFuture-0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "da1440e9a54fe3aefcf6cd8fd7ebc92c", "sha256": "9396c52dd367029d2f0b7a4254f9f5ee8ba3139f0293fc60ad5104af1271f555" }, "downloads": -1, "filename": "HumanFuture-0.2.tar.gz", "has_sig": false, "md5_digest": "da1440e9a54fe3aefcf6cd8fd7ebc92c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3330, "upload_time": "2012-08-06T19:54:37", "url": "https://files.pythonhosted.org/packages/74/5e/104e069369c489d9282a89af8038d245120aa00be38f3484f97d4304e46b/HumanFuture-0.2.tar.gz" } ] }