Flask-SQLAlchemy


NameFlask-SQLAlchemy JSON
Version 2.5.1 PyPI version JSON
download
home_pagehttps://github.com/pallets/flask-sqlalchemy
SummaryAdds SQLAlchemy support to your Flask application.
upload_time2021-03-18 19:03:02
maintainerPallets
docs_urlhttps://pythonhosted.org/Flask-SQLAlchemy/
authorArmin Ronacher
requires_python>= 2.7, != 3.0.*, != 3.1.*, != 3.2.*, != 3.3.*
licenseBSD-3-Clause
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Flask-SQLAlchemy
================

Flask-SQLAlchemy is an extension for `Flask`_ that adds support for
`SQLAlchemy`_ to your application. It aims to simplify using SQLAlchemy
with Flask by providing useful defaults and extra helpers that make it
easier to accomplish common tasks.


Installing
----------

Install and update using `pip`_:

.. code-block:: text

  $ pip install -U Flask-SQLAlchemy


A Simple Example
----------------

.. code-block:: python

    from flask import Flask
    from flask_sqlalchemy import SQLAlchemy

    app = Flask(__name__)
    app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///example.sqlite"
    db = SQLAlchemy(app)


    class User(db.Model):
        id = db.Column(db.Integer, primary_key=True)
        username = db.Column(db.String, unique=True, nullable=False)
        email = db.Column(db.String, unique=True, nullable=False)


    db.session.add(User(name="Flask", email="example@example.com"))
    db.session.commit()

    users = User.query.all()


Links
-----

-   Documentation: https://flask-sqlalchemy.palletsprojects.com/
-   Releases: https://pypi.org/project/Flask-SQLAlchemy/
-   Code: https://github.com/pallets/flask-sqlalchemy
-   Issue tracker: https://github.com/pallets/flask-sqlalchemy/issues
-   Test status: https://travis-ci.org/pallets/flask-sqlalchemy
-   Test coverage: https://codecov.io/gh/pallets/flask-sqlalchemy

.. _Flask: https://palletsprojects.com/p/flask/
.. _SQLAlchemy: https://www.sqlalchemy.org
.. _pip: https://pip.pypa.io/en/stable/quickstart/



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/pallets/flask-sqlalchemy",
    "name": "Flask-SQLAlchemy",
    "maintainer": "Pallets",
    "docs_url": "https://pythonhosted.org/Flask-SQLAlchemy/",
    "requires_python": ">= 2.7, != 3.0.*, != 3.1.*, != 3.2.*, != 3.3.*",
    "maintainer_email": "contact@palletsprojects.com",
    "keywords": "",
    "author": "Armin Ronacher",
    "author_email": "armin.ronacher@active-4.com",
    "download_url": "https://files.pythonhosted.org/packages/35/f0/39dd2d8e7e5223f78a5206d7020dc0e16718a964acfb3564d89e9798ab9b/Flask-SQLAlchemy-2.5.1.tar.gz",
    "platform": "",
    "description": "Flask-SQLAlchemy\n================\n\nFlask-SQLAlchemy is an extension for `Flask`_ that adds support for\n`SQLAlchemy`_ to your application. It aims to simplify using SQLAlchemy\nwith Flask by providing useful defaults and extra helpers that make it\neasier to accomplish common tasks.\n\n\nInstalling\n----------\n\nInstall and update using `pip`_:\n\n.. code-block:: text\n\n  $ pip install -U Flask-SQLAlchemy\n\n\nA Simple Example\n----------------\n\n.. code-block:: python\n\n    from flask import Flask\n    from flask_sqlalchemy import SQLAlchemy\n\n    app = Flask(__name__)\n    app.config[\"SQLALCHEMY_DATABASE_URI\"] = \"sqlite:///example.sqlite\"\n    db = SQLAlchemy(app)\n\n\n    class User(db.Model):\n        id = db.Column(db.Integer, primary_key=True)\n        username = db.Column(db.String, unique=True, nullable=False)\n        email = db.Column(db.String, unique=True, nullable=False)\n\n\n    db.session.add(User(name=\"Flask\", email=\"example@example.com\"))\n    db.session.commit()\n\n    users = User.query.all()\n\n\nLinks\n-----\n\n-   Documentation: https://flask-sqlalchemy.palletsprojects.com/\n-   Releases: https://pypi.org/project/Flask-SQLAlchemy/\n-   Code: https://github.com/pallets/flask-sqlalchemy\n-   Issue tracker: https://github.com/pallets/flask-sqlalchemy/issues\n-   Test status: https://travis-ci.org/pallets/flask-sqlalchemy\n-   Test coverage: https://codecov.io/gh/pallets/flask-sqlalchemy\n\n.. _Flask: https://palletsprojects.com/p/flask/\n.. _SQLAlchemy: https://www.sqlalchemy.org\n.. _pip: https://pip.pypa.io/en/stable/quickstart/\n\n\n",
    "bugtrack_url": null,
    "license": "BSD-3-Clause",
    "summary": "Adds SQLAlchemy support to your Flask application.",
    "version": "2.5.1",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "e1cf21156434a9eaf1e47738d4267bbf",
                "sha256": "f12c3d4cc5cc7fdcc148b9527ea05671718c3ea45d50c7e732cceb33f574b390"
            },
            "downloads": -1,
            "filename": "Flask_SQLAlchemy-2.5.1-py2.py3-none-any.whl",
            "has_sig": true,
            "md5_digest": "e1cf21156434a9eaf1e47738d4267bbf",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">= 2.7, != 3.0.*, != 3.1.*, != 3.2.*, != 3.3.*",
            "size": 17716,
            "upload_time": "2021-03-18T19:03:00",
            "upload_time_iso_8601": "2021-03-18T19:03:00.702641Z",
            "url": "https://files.pythonhosted.org/packages/26/2c/9088b6bd95bca539230bbe9ad446737ed391aab9a83aff403e18dded3e75/Flask_SQLAlchemy-2.5.1-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "dcb6b62248ced71dab183f2cb2778583",
                "sha256": "2bda44b43e7cacb15d4e05ff3cc1f8bc97936cc464623424102bfc2c35e95912"
            },
            "downloads": -1,
            "filename": "Flask-SQLAlchemy-2.5.1.tar.gz",
            "has_sig": true,
            "md5_digest": "dcb6b62248ced71dab183f2cb2778583",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">= 2.7, != 3.0.*, != 3.1.*, != 3.2.*, != 3.3.*",
            "size": 132750,
            "upload_time": "2021-03-18T19:03:02",
            "upload_time_iso_8601": "2021-03-18T19:03:02.733091Z",
            "url": "https://files.pythonhosted.org/packages/35/f0/39dd2d8e7e5223f78a5206d7020dc0e16718a964acfb3564d89e9798ab9b/Flask-SQLAlchemy-2.5.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2021-03-18 19:03:02",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "pallets",
    "github_project": "flask-sqlalchemy",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "flask-sqlalchemy"
}
        
Elapsed time: 0.59197s