flask-json-db


Nameflask-json-db JSON
Version 0.0.1 PyPI version JSON
download
home_pagehttps://github.com/Agent-Hellboy/flask-json-db
SummaryA flask extension to log a python object in json file
upload_time2022-12-20 14:40:45
maintainer
docs_urlNone
authorPrince Roshan
requires_python>=3.7
licenseMIT
keywords flask-extension log-variable
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            flask-json-db
=============

A flask extension to log a variable value inside view in a JSON file


Installation
============

For stable version 
   - pip install flask-json-db

For developement 
   - git clone https://github.com/Agent-Hellboy/flask-json-db
   - cd flask-json-db
   - python -m venv .venv 
   - source .venv/bin/activate

Example
=======

.. code:: py

    from flask import Flask
    from flask_json_db import JSONDB

    app = Flask(__name__)
    app.config["JSONFILE"] = "custom.json" #optional 
    json_db = JSONDB(app)

    @app.route('/')
    def hello_world():
        json_db.write({"landing_view_var":"landing_view_var_value"})
        return 'Hello World'

    @app.route("/home")
    def home():
        json_db.write({"home_var":["jshajdhjs"]})
        return 'ghj'

    @app.route("/new_home")
    def new_home():
        db.write({"new_home_var": "new_home_var_value"})
        return "hjk"

    if __name__ == '__main__':
        app.run()

    open the custom.json and get to know about these variable values

General Info
============

   - I don't know how can it be helpful but it is helpful for me :)

   
Contributing
============

Pull requests are welcome. For major changes, please open an issue first
to discuss what you would like to change.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Agent-Hellboy/flask-json-db",
    "name": "flask-json-db",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "flask-extension,log-variable",
    "author": "Prince Roshan",
    "author_email": "princekrroshan01@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/7d/4b/2f5bfde2fc677cde4fb16d0f9962fdcac0d66f0ad27cfc92636bde6d0e32/flask-json-db-0.0.1.tar.gz",
    "platform": null,
    "description": "flask-json-db\n=============\n\nA flask extension to log a variable value inside view in a JSON file\n\n\nInstallation\n============\n\nFor stable version \n   - pip install flask-json-db\n\nFor developement \n   - git clone https://github.com/Agent-Hellboy/flask-json-db\n   - cd flask-json-db\n   - python -m venv .venv \n   - source .venv/bin/activate\n\nExample\n=======\n\n.. code:: py\n\n    from flask import Flask\n    from flask_json_db import JSONDB\n\n    app = Flask(__name__)\n    app.config[\"JSONFILE\"] = \"custom.json\" #optional \n    json_db = JSONDB(app)\n\n    @app.route('/')\n    def hello_world():\n        json_db.write({\"landing_view_var\":\"landing_view_var_value\"})\n        return 'Hello World'\n\n    @app.route(\"/home\")\n    def home():\n        json_db.write({\"home_var\":[\"jshajdhjs\"]})\n        return 'ghj'\n\n    @app.route(\"/new_home\")\n    def new_home():\n        db.write({\"new_home_var\": \"new_home_var_value\"})\n        return \"hjk\"\n\n    if __name__ == '__main__':\n        app.run()\n\n    open the custom.json and get to know about these variable values\n\nGeneral Info\n============\n\n   - I don't know how can it be helpful but it is helpful for me :)\n\n   \nContributing\n============\n\nPull requests are welcome. For major changes, please open an issue first\nto discuss what you would like to change.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A flask extension to log a python object in json file",
    "version": "0.0.1",
    "split_keywords": [
        "flask-extension",
        "log-variable"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "8cafe3e7102d29ec59f2374e59dd5617",
                "sha256": "f81e437396fcdfa8872a023c571cc12e1273198d684ba81202435fb82b04c5c7"
            },
            "downloads": -1,
            "filename": "flask_json_db-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8cafe3e7102d29ec59f2374e59dd5617",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 3169,
            "upload_time": "2022-12-20T14:40:43",
            "upload_time_iso_8601": "2022-12-20T14:40:43.478213Z",
            "url": "https://files.pythonhosted.org/packages/71/fc/ff91da929a542a5112f69bc0b4f2c66084ac1069bb5709b932114db4a604/flask_json_db-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "0336b55b5d8b7c0f845ad5d63a746c3c",
                "sha256": "2b99ebc2d5de5989137451953bd786fd56851a9a586e3ac1ae480abb51a9289b"
            },
            "downloads": -1,
            "filename": "flask-json-db-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "0336b55b5d8b7c0f845ad5d63a746c3c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 2900,
            "upload_time": "2022-12-20T14:40:45",
            "upload_time_iso_8601": "2022-12-20T14:40:45.785464Z",
            "url": "https://files.pythonhosted.org/packages/7d/4b/2f5bfde2fc677cde4fb16d0f9962fdcac0d66f0ad27cfc92636bde6d0e32/flask-json-db-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-20 14:40:45",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "Agent-Hellboy",
    "github_project": "flask-json-db",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "flask-json-db"
}
        
Elapsed time: 0.18679s