{ "info": { "author": "Justine Tunney", "author_email": "jtunney@lobstertech.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python" ], "description": ".. -*-rst-*-\n\n==========\n timespan\n==========\n\n:name: timespan\n:description: Check if timestamp falls within specific boundaries\n:copyright: \u00a9 2012 Justine Alexandra Roberts Tunney\n:license: MIT\n\n\nWhat Is This?\n=============\n\nTimespans allow you to check if a timestamp falls within a specified list of\nboundaries. For example, you might want to program your phone system to only\naccept calls Mon-Fri from 9 a.m. to 5 p.m. except on holidays like Christmas.\n\nTimespans are specified in the form of ``times|daysofweek|days|months``. If\nyour timespan starts with ``!``, it'll only match if the timestamps falls\noutside the given range.\n\nBasic example::\n\n import timespan\n from datetime import datetime\n\n business_hours = [\n '9:00-17:00|mon-fri|*|*', # is between 9 a.m. to 5 p.m. on Mon to Fri\n '!*|*|1|jan', # not new years\n '!*|*|25|dec', # not christmas\n '!*|thu|22-28|nov', # not thanksgiving\n ]\n\n if timespan.match(business_hours, datetime.now()):\n print \"we're open for business!\"\n else:\n print \"sorry, we're closed :(\"\n\nFor more examples, see the documentation or source code.\n\n\nInstallation\n============\n\nFrom folder::\n\n sudo python setup.py install\n\nFrom cheeseshop::\n\n sudo pip install timespan\n\nFrom git::\n\n sudo pip install git+git://github.com/jart/timespan.git", "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/jart/timespan", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "timespan", "package_url": "https://pypi.org/project/timespan/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/timespan/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/jart/timespan" }, "release_url": "https://pypi.org/project/timespan/0.1/", "requires_dist": null, "requires_python": null, "summary": "Check if timestamp falls within specific boundaries", "version": "0.1" }, "last_serial": 800697, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "73620954333bd639476e4040faed9c20", "sha256": "3bda81342acc98188baf534c357ced76dbc9067c417513037ccb7649c3f0c2bd" }, "downloads": -1, "filename": "timespan-0.1.tar.gz", "has_sig": false, "md5_digest": "73620954333bd639476e4040faed9c20", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4269, "upload_time": "2012-03-30T05:44:26", "url": "https://files.pythonhosted.org/packages/0f/cd/ea6913e0966290240537112e255f4f986ed093ad39b2070abe6175091bdd/timespan-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "73620954333bd639476e4040faed9c20", "sha256": "3bda81342acc98188baf534c357ced76dbc9067c417513037ccb7649c3f0c2bd" }, "downloads": -1, "filename": "timespan-0.1.tar.gz", "has_sig": false, "md5_digest": "73620954333bd639476e4040faed9c20", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4269, "upload_time": "2012-03-30T05:44:26", "url": "https://files.pythonhosted.org/packages/0f/cd/ea6913e0966290240537112e255f4f986ed093ad39b2070abe6175091bdd/timespan-0.1.tar.gz" } ] }