{ "info": { "author": "Chris Byrd", "author_email": "christopher.byrd2013@gmail.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 3 :: Only" ], "description": "# JSONite - The Python-to-Javascript variable transformer for Masonite\n\nThis package is intended to be used alongside the [Masonite Framework](https://github.com/MasoniteFramework/masonite) and allows you to pass Python variables to your base template. If no data is passed to the `Javascript` object on a particular request then the object returns an empty string, else it returns a JSON object featuring the passed data.\n\n## Installation:\n\nJSONite can be installed in your Masonite project's home directory with pip:\n\n```bash\npip install JSONite\n```\n\n## Setup\n\nAfter installing JSONite, you'll need to add the `JavascriptProvider` to your application providers in `config/providers.py`.\n\n```python\n# config/providers.py\n\n# ...\n\nfrom jsonite import JavascriptProvider\n\n# ...\n\nPROVIDERS = [\n # ...\n\n # Third Party Providers\n JavascriptProvider,\n\n # ...\n]\n\n```\n\nAfter adding the provider, you'll need to add the `JavascripMiddleware` class to `config/middleware.py`.\n\n```python\n# config/middleware.py\n\n# ...\n\nfrom jsonite import JavascriptMiddleware\n\n# ...\n\nHTTP_MIDDLEWARE = [\n # ...\n JavascriptMiddleware,\n]\n\n# ...\n\n```\n\nLastly, you'll want to add the line that actually renders the Javascript in your `base.html` file. By default the function name will be `javascript_data()`, but you can customize this by setting the desired value to the environment variable `JS_TEMPLATE_VAR` in your `.env` file.\n\n```html\n\n\n\n \n\n \n {{ javascript_data() }}\n \n\n\n``` \n\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ChrisByrd14/JSONite", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "JSONite", "package_url": "https://pypi.org/project/JSONite/", "platform": "", "project_url": "https://pypi.org/project/JSONite/", "project_urls": { "Homepage": "https://github.com/ChrisByrd14/JSONite" }, "release_url": "https://pypi.org/project/JSONite/0.0.3/", "requires_dist": [ "masonite (>=2)" ], "requires_python": "", "summary": "Python to Javascript variable converter for the Masonite framework.", "version": "0.0.3" }, "last_serial": 5998510, "releases": { "0.0.2": [ { "comment_text": "", "digests": { "md5": "76a7c6c99f68ab83d9797382a19af8fc", "sha256": "204a9b7ab438d2c5d4472379f4de2d96321429d50eec408535681def6434ebe5" }, "downloads": -1, "filename": "JSONite-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "76a7c6c99f68ab83d9797382a19af8fc", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5351, "upload_time": "2019-10-18T21:42:45", "url": "https://files.pythonhosted.org/packages/89/b8/11bf0a1bf692cb6c664f32775d1738d9c20378a7ddfc0ffbcae803847a87/JSONite-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1986ab8450b6e00363ca55ca42c7499f", "sha256": "5f56598b3ebba9a8d73d5aa3212caa94255c4e4011cc8b004f957f5da57b3e58" }, "downloads": -1, "filename": "JSONite-0.0.2.tar.gz", "has_sig": false, "md5_digest": "1986ab8450b6e00363ca55ca42c7499f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3447, "upload_time": "2019-10-18T21:42:48", "url": "https://files.pythonhosted.org/packages/9a/1f/27e9e3e7284eae766181f6136bf116951c9bb79dbae1d00e6c4eade2840b/JSONite-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "e63545b6444200004393d1b17b19f4d1", "sha256": "cce6f474dd02d7b3f552cdeca5cb64445d3d17acef5946adec68ad59ee3f4d12" }, "downloads": -1, "filename": "JSONite-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "e63545b6444200004393d1b17b19f4d1", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5283, "upload_time": "2019-10-19T03:13:42", "url": "https://files.pythonhosted.org/packages/86/50/568c82d687bb96529ea26076ece1000de780d6f2d83e120f1674084d99f0/JSONite-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3217076333c301bfd91a2fd452858473", "sha256": "9950ee5fadd7e9dbd33d59c22dd945d57cadaa2e123f26538872e1956933d034" }, "downloads": -1, "filename": "JSONite-0.0.3.tar.gz", "has_sig": false, "md5_digest": "3217076333c301bfd91a2fd452858473", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3482, "upload_time": "2019-10-19T03:13:44", "url": "https://files.pythonhosted.org/packages/05/2c/3e2902711a1461a42689068e0137a7ca0e4d10fbe9799e2a1601e4f69db9/JSONite-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e63545b6444200004393d1b17b19f4d1", "sha256": "cce6f474dd02d7b3f552cdeca5cb64445d3d17acef5946adec68ad59ee3f4d12" }, "downloads": -1, "filename": "JSONite-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "e63545b6444200004393d1b17b19f4d1", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5283, "upload_time": "2019-10-19T03:13:42", "url": "https://files.pythonhosted.org/packages/86/50/568c82d687bb96529ea26076ece1000de780d6f2d83e120f1674084d99f0/JSONite-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3217076333c301bfd91a2fd452858473", "sha256": "9950ee5fadd7e9dbd33d59c22dd945d57cadaa2e123f26538872e1956933d034" }, "downloads": -1, "filename": "JSONite-0.0.3.tar.gz", "has_sig": false, "md5_digest": "3217076333c301bfd91a2fd452858473", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3482, "upload_time": "2019-10-19T03:13:44", "url": "https://files.pythonhosted.org/packages/05/2c/3e2902711a1461a42689068e0137a7ca0e4d10fbe9799e2a1601e4f69db9/JSONite-0.0.3.tar.gz" } ] }