{"id":13813933,"url":"https://github.com/pyeve/eve-sqlalchemy","last_synced_at":"2025-04-07T16:17:39.317Z","repository":{"id":25412308,"uuid":"28841389","full_name":"pyeve/eve-sqlalchemy","owner":"pyeve","description":"SQLAlchemy data layer for Eve-powered RESTful APIs","archived":false,"fork":false,"pushed_at":"2024-09-11T10:20:44.000Z","size":425,"stargazers_count":234,"open_issues_count":43,"forks_count":70,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-03-31T15:17:48.689Z","etag":null,"topics":["flask","python","rest","sqlalchemy"],"latest_commit_sha":null,"homepage":"http://eve-sqlalchemy.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pyeve.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-01-06T01:47:02.000Z","updated_at":"2025-03-07T05:37:08.000Z","dependencies_parsed_at":"2024-09-29T11:42:20.248Z","dependency_job_id":"c2c359c6-a501-49cd-bb39-6cc9858e08ec","html_url":"https://github.com/pyeve/eve-sqlalchemy","commit_stats":{"total_commits":233,"total_committers":24,"mean_commits":9.708333333333334,"dds":0.5278969957081545,"last_synced_commit":"d5c8081457a32a35a1abd6cee4bfa9420f4e05af"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyeve%2Feve-sqlalchemy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyeve%2Feve-sqlalchemy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyeve%2Feve-sqlalchemy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyeve%2Feve-sqlalchemy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pyeve","download_url":"https://codeload.github.com/pyeve/eve-sqlalchemy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247685628,"owners_count":20979085,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flask","python","rest","sqlalchemy"],"created_at":"2024-08-04T04:01:37.176Z","updated_at":"2025-04-07T16:17:39.280Z","avatar_url":"https://github.com/pyeve.png","language":"Python","readme":"Eve-SQLAlchemy extension\n========================\n\n.. image:: https://travis-ci.org/pyeve/eve-sqlalchemy.svg?branch=master\n   :target: https://travis-ci.org/pyeve/eve-sqlalchemy\n\nPowered by Eve, SQLAlchemy and good intentions this extension allows\nto effortlessly build and deploy highly customizable, fully featured\nRESTful Web Services with SQL-based backends.\n\nMaintenance Notice\n------------------\n\nAs of some years ago, Eve-SQLAlchemy has been effectively unmaintained. I am no\nlonger actively using it, which makes it increasingly difficult to find the\ntime for even small updates. If anyone is interested in taking over maintenance\nof Eve-SQLAlchemy, please reach out to me.\n\nEve-SQLAlchemy is simple\n------------------------\n\nThe following code blocks are excerpts of ``examples/one_to_many`` and should\ngive you an idea of how Eve-SQLAlchemy is used. A complete working example can\nbe found there. If you are not familiar with `Eve \u003chttps://python-eve.org/\u003e`_\nand `SQLAlchemy \u003chttps://www.sqlalchemy.org/\u003e`_, it is recommended to read up\non them first.\n\nFor this example, we declare two SQLAlchemy mappings (from ``domain.py``):\n\n.. code-block:: python\n\n    class Parent(BaseModel):\n        __tablename__ = 'parent'\n        id = Column(Integer, primary_key=True)\n        children = relationship(\"Child\")\n\n    class Child(BaseModel):\n        __tablename__ = 'child'\n        id = Column(Integer, primary_key=True)\n        parent_id = Column(Integer, ForeignKey('parent.id'))\n\nAs for Eve, a ``settings.py`` is used to configure our API. Eve-SQLAlchemy,\nhaving access to a lot of metadata from your models, can automatically generate\na great deal of the `DOMAIN` dictionary for you:\n\n.. code-block:: python\n\n    DEBUG = True\n    SQLALCHEMY_DATABASE_URI = 'sqlite://'\n    SQLALCHEMY_TRACK_MODIFICATIONS = False\n    RESOURCE_METHODS = ['GET', 'POST']\n\n    DOMAIN = DomainConfig({\n        'parents': ResourceConfig(Parent),\n        'children': ResourceConfig(Child)\n    }).render()\n\nFinally, running our application server is easy (from ``app.py``):\n\n.. code-block:: python\n\n    app = Eve(validator=ValidatorSQL, data=SQL)\n\n    db = app.data.driver\n    Base.metadata.bind = db.engine\n    db.Model = Base\n\n    # create database schema on startup and populate some example data\n    db.create_all()\n    db.session.add_all([Parent(children=[Child() for k in range(n)])\n                        for n in range(10)])\n    db.session.commit()\n\n    # using reloader will destroy the in-memory sqlite db\n    app.run(debug=True, use_reloader=False)\n\nThe API is now live, ready to be consumed:\n\n.. code-block:: console\n\n    $ curl -s http://localhost:5000/parents | python -m json.tool\n\n.. code-block:: json\n\n    {\n        \"_items\": [\n            {\n                \"_created\": \"Sun, 22 Oct 2017 07:58:28 GMT\",\n                \"_etag\": \"f56d7cb013bf3d8449e11e8e1f0213f5efd0f07d\",\n                \"_links\": {\n                    \"self\": {\n                        \"href\": \"parents/1\",\n                        \"title\": \"Parent\"\n                    }\n                },\n                \"_updated\": \"Sun, 22 Oct 2017 07:58:28 GMT\",\n                \"children\": [],\n                \"id\": 1\n            },\n            {\n                \"_created\": \"Sun, 22 Oct 2017 07:58:28 GMT\",\n                \"_etag\": \"dd1698161cb6beef04f564b2e18804d4a7c4330d\",\n                \"_links\": {\n                    \"self\": {\n                        \"href\": \"parents/2\",\n                        \"title\": \"Parent\"\n                    }\n                },\n                \"_updated\": \"Sun, 22 Oct 2017 07:58:28 GMT\",\n                \"children\": [\n                    1\n                ],\n                \"id\": 2\n            },\n            \"...\"\n        ],\n        \"_links\": {\n            \"parent\": {\n                \"href\": \"/\",\n                \"title\": \"home\"\n            },\n            \"self\": {\n                \"href\": \"parents\",\n                \"title\": \"parents\"\n            }\n        },\n        \"_meta\": {\n            \"max_results\": 25,\n            \"page\": 1,\n            \"total\": 10\n        }\n    }\n\nAll you need to bring your API online is a database, a configuration\nfile (defaults to ``settings.py``) and a launch script.  Overall, you\nwill find that configuring and fine-tuning your API is a very simple\nprocess.\n\nEve-SQLAlchemy is thoroughly tested under Python 2.7-3.7 and PyPy.\n\nDocumentation\n-------------\n\nThe offical project documentation can be accessed at\n`eve-sqlalchemy.readthedocs.org\n\u003chttps://eve-sqlalchemy.readthedocs.org/\u003e`_. For full working examples,\nespecially regarding different relationship types, see the ``examples``\ndirectory in this repository.\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyeve%2Feve-sqlalchemy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpyeve%2Feve-sqlalchemy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyeve%2Feve-sqlalchemy/lists"}