{ "info": { "author": "Raphael Pierzina", "author_email": "raphael@hackebrot.de", "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", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy" ], "description": "===========\nJinja2 Time\n===========\n\n|pypi| |pyversions| |license| |travis-ci|\n\nJinja2 Extension for Dates and Times\n\n.. |pypi| image:: https://img.shields.io/pypi/v/jinja2-time.svg\n :target: https://pypi.python.org/pypi/jinja2-time\n :alt: PyPI Package\n\n.. |pyversions| image:: https://img.shields.io/pypi/pyversions/jinja2-time.svg\n :target: https://pypi.python.org/pypi/jinja2-time/\n :alt: PyPI Python Versions\n\n.. |license| image:: https://img.shields.io/pypi/l/jinja2-time.svg\n :target: https://pypi.python.org/pypi/jinja2-time\n :alt: PyPI Package License\n\n.. |travis-ci| image:: https://travis-ci.org/hackebrot/jinja2-time.svg?branch=master\n :target: https://travis-ci.org/hackebrot/jinja2-time\n :alt: See Build Status on Travis CI\n\nInstallation\n------------\n\n**jinja2-time** is available for download from `PyPI`_ via `pip`_::\n\n $ pip install jinja2-time\n\nIt will automatically install `jinja2`_ along with `arrow`_.\n\n.. _`jinja2`: https://github.com/mitsuhiko/jinja2\n.. _`PyPI`: https://pypi.python.org/pypi\n.. _`arrow`: https://github.com/crsmithdev/arrow\n.. _`pip`: https://pypi.python.org/pypi/pip/\n\nUsage\n-----\n\nNow Tag\n~~~~~~~\n\nThe extension comes with a ``now`` tag that provides convenient access to the\n`arrow.now()`_ API from your templates.\n\nYou can control the output by specifying a format, that will be passed to\nPython's `strftime()`_:\n\n.. _`arrow.now()`: http://crsmithdev.com/arrow/#arrow.factory.ArrowFactory.now\n.. _`strftime()`: https://docs.python.org/3.5/library/datetime.html#strftime-and-strptime-behavior\n\n.. code-block:: python\n\n from jinja2 import Environment\n\n env = Environment(extensions=['jinja2_time.TimeExtension'])\n\n # Timezone 'local', default format -> \"2015-12-10\"\n template = env.from_string(\"{% now 'local' %}\")\n\n # Timezone 'utc', explicit format -> \"Thu, 10 Dec 2015 15:49:01\"\n template = env.from_string(\"{% now 'utc', '%a, %d %b %Y %H:%M:%S' %}\")\n\n # Timezone 'Europe/Berlin', explicit format -> \"CET +0100\"\n template = env.from_string(\"{% now 'Europe/Berlin', '%Z %z' %}\")\n\n # Timezone 'utc', explicit format -> \"2015\"\n template = env.from_string(\"{% now 'utc', '%Y' %}\")\n\n template.render()\n\nDefault Datetime Format\n~~~~~~~~~~~~~~~~~~~~~~~\n\n**TimeExtension** extends the environment with a ``datetime_format`` attribute.\n\nIt is used as a fallback if you omit the format for ``now``.\n\n.. code-block:: python\n\n from jinja2 import Environment\n\n env = Environment(extensions=['jinja2_time.TimeExtension'])\n\n env.datetime_format = '%a, %d %b %Y %H:%M:%S'\n\n # Timezone 'utc', default format -> \"Thu, 10 Dec 2015 15:49:01\"\n template = env.from_string(\"{% now 'utc' %}\")\n\n template.render()\n\nTime Offset\n~~~~~~~~~~~\n\n**jinja2-time** implements a convenient interface to modify ``now`` by a\nrelative time offset:\n\n.. code-block:: python\n\n # Examples for now \"2015-12-09 23:33:01\"\n\n # \"Thu, 10 Dec 2015 01:33:31\"\n \"{% now 'utc' + 'hours=2, seconds=30' %}\"\n\n # \"Wed, 09 Dec 2015 23:22:01\"\n \"{% now 'utc' - 'minutes=11' %}\"\n\n # \"07 Dec 2015 23:00:00\"\n \"{% now 'utc' - 'days=2, minutes=33, seconds=1', '%d %b %Y %H:%M:%S' %}\"\n\nFurther documentation on the underlying functionality can be found in the\n`arrow replace docs`_.\n\n.. _`arrow replace docs`: http://arrow.readthedocs.io/en/latest/#replace-shift\n\n\nIssues\n------\n\nIf you encounter any problems, please `file an issue`_ along with a detailed description.\n\n.. _`file an issue`: https://github.com/hackebrot/jinja2-time/issues\n\n\nCode of Conduct\n---------------\n\nEveryone interacting in the jinja2-time project's codebases, issue trackers, chat\nrooms, and mailing lists is expected to follow the `PyPA Code of Conduct`_.\n\n.. _`PyPA Code of Conduct`: https://www.pypa.io/en/latest/code-of-conduct/\n\nLicense\n-------\n\nDistributed under the terms of the `MIT`_ license, jinja2-time is free and open source software\n\n.. image:: https://opensource.org/trademarks/osi-certified/web/osi-certified-120x100.png\n :align: left\n :alt: OSI certified\n :target: https://opensource.org/\n\n.. _`MIT`: http://opensource.org/licenses/MIT", "description_content_type": null, "docs_url": null, "download_url": null, "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/hackebrot/jinja2-time", "keywords": "jinja2,extension,time", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "jinja2-time", "package_url": "https://pypi.org/project/jinja2-time/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/jinja2-time/", "project_urls": { "Homepage": "https://github.com/hackebrot/jinja2-time" }, "release_url": "https://pypi.org/project/jinja2-time/0.2.0/", "requires_dist": null, "requires_python": null, "summary": "Jinja2 Extension for Dates and Times", "version": "0.2.0" }, "last_serial": 2157859, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "78d2f4e7726de4f3132ca07f46047d2b", "sha256": "edf39817f07bf088eabc7c3dbcb9902af3721a4ca9a849873d0d5dfeb5a80318" }, "downloads": -1, "filename": "jinja2_time-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "78d2f4e7726de4f3132ca07f46047d2b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5544, "upload_time": "2015-12-11T11:16:27", "url": "https://files.pythonhosted.org/packages/98/96/66ed871f0012db79107f988cf6bde960015e9be3b54adb057ce77fa2a391/jinja2_time-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bc14d8196c223e94061c9e9fa393a563", "sha256": "e1dc60e917be18e7b07d5e908531ff55134f2bb67e1aeb4573a1d0267f33aa91" }, "downloads": -1, "filename": "jinja2-time-0.1.0.tar.gz", "has_sig": false, "md5_digest": "bc14d8196c223e94061c9e9fa393a563", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4852, "upload_time": "2015-12-11T11:16:35", "url": "https://files.pythonhosted.org/packages/56/60/e1c8fdaa735c6eb7b9c3ca4466622d8ddf02154682ce0449c2c7b05c4ec4/jinja2-time-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "d0d553ae5c3e9e7abb79c044acd165c8", "sha256": "d3eab6605e3ec8b7a0863df09cc1d23714908fa61aa6986a845c20ba488b4efa" }, "downloads": -1, "filename": "jinja2_time-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "d0d553ae5c3e9e7abb79c044acd165c8", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6360, "upload_time": "2016-06-08T23:36:48", "url": "https://files.pythonhosted.org/packages/6a/a1/d44fa38306ffa34a7e1af09632b158e13ec89670ce491f8a15af3ebcb4e4/jinja2_time-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b6ebc4ecac395a18982532f4c2869c06", "sha256": "d14eaa4d315e7688daa4969f616f226614350c48730bfa1692d2caebd8c90d40" }, "downloads": -1, "filename": "jinja2-time-0.2.0.tar.gz", "has_sig": false, "md5_digest": "b6ebc4ecac395a18982532f4c2869c06", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5701, "upload_time": "2016-06-08T23:36:52", "url": "https://files.pythonhosted.org/packages/de/7c/ee2f2014a2a0616ad3328e58e7dac879251babdb4cb796d770b5d32c469f/jinja2-time-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d0d553ae5c3e9e7abb79c044acd165c8", "sha256": "d3eab6605e3ec8b7a0863df09cc1d23714908fa61aa6986a845c20ba488b4efa" }, "downloads": -1, "filename": "jinja2_time-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "d0d553ae5c3e9e7abb79c044acd165c8", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6360, "upload_time": "2016-06-08T23:36:48", "url": "https://files.pythonhosted.org/packages/6a/a1/d44fa38306ffa34a7e1af09632b158e13ec89670ce491f8a15af3ebcb4e4/jinja2_time-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b6ebc4ecac395a18982532f4c2869c06", "sha256": "d14eaa4d315e7688daa4969f616f226614350c48730bfa1692d2caebd8c90d40" }, "downloads": -1, "filename": "jinja2-time-0.2.0.tar.gz", "has_sig": false, "md5_digest": "b6ebc4ecac395a18982532f4c2869c06", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5701, "upload_time": "2016-06-08T23:36:52", "url": "https://files.pythonhosted.org/packages/de/7c/ee2f2014a2a0616ad3328e58e7dac879251babdb4cb796d770b5d32c469f/jinja2-time-0.2.0.tar.gz" } ] }