{"id":13421669,"url":"https://github.com/marshmallow-code/flask-marshmallow","last_synced_at":"2025-05-13T19:06:57.036Z","repository":{"id":16412816,"uuid":"19163893","full_name":"marshmallow-code/flask-marshmallow","owner":"marshmallow-code","description":"Flask + marshmallow for beautiful APIs","archived":false,"fork":false,"pushed_at":"2025-05-05T20:37:18.000Z","size":437,"stargazers_count":886,"open_issues_count":26,"forks_count":57,"subscribers_count":15,"default_branch":"dev","last_synced_at":"2025-05-05T21:39:44.309Z","etag":null,"topics":["flask","marshmallow","python","python-3","rest-api","sqlalchemy"],"latest_commit_sha":null,"homepage":"http://flask-marshmallow.readthedocs.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"williballenthin/viv-utils","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marshmallow-code.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","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":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-04-25T23:35:09.000Z","updated_at":"2025-05-05T20:37:20.000Z","dependencies_parsed_at":"2023-01-13T18:50:07.078Z","dependency_job_id":"442e4922-669e-40eb-86fd-ab52fd5b3c91","html_url":"https://github.com/marshmallow-code/flask-marshmallow","commit_stats":{"total_commits":382,"total_committers":22,"mean_commits":"17.363636363636363","dds":"0.46335078534031415","last_synced_commit":"5bace3b264934d77889b44a53a3d38bc27d79512"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marshmallow-code%2Fflask-marshmallow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marshmallow-code%2Fflask-marshmallow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marshmallow-code%2Fflask-marshmallow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marshmallow-code%2Fflask-marshmallow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marshmallow-code","download_url":"https://codeload.github.com/marshmallow-code/flask-marshmallow/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253601951,"owners_count":21934408,"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","marshmallow","python","python-3","rest-api","sqlalchemy"],"created_at":"2024-07-30T23:00:27.974Z","updated_at":"2025-05-13T19:06:56.982Z","avatar_url":"https://github.com/marshmallow-code.png","language":"Python","readme":"*****************\nFlask-Marshmallow\n*****************\n\n|pypi-package| |build-status| |docs| |marshmallow-support|\n\nFlask + marshmallow for beautiful APIs\n======================================\n\nFlask-Marshmallow is a thin integration layer for `Flask`_ (a Python web framework) and `marshmallow`_ (an object serialization/deserialization library) that adds additional features to marshmallow, including URL and Hyperlinks fields for HATEOAS-ready APIs. It also (optionally) integrates with `Flask-SQLAlchemy \u003chttp://flask-sqlalchemy.pocoo.org/\u003e`_.\n\nGet it now\n----------\n::\n\n    pip install flask-marshmallow\n\n\nCreate your app.\n\n.. code-block:: python\n\n    from flask import Flask\n    from flask_marshmallow import Marshmallow\n\n    app = Flask(__name__)\n    ma = Marshmallow(app)\n\nWrite your models.\n\n.. code-block:: python\n\n    from your_orm import Model, Column, Integer, String, DateTime\n\n\n    class User(Model):\n        email = Column(String)\n        password = Column(String)\n        date_created = Column(DateTime, auto_now_add=True)\n\n\nDefine your output format with marshmallow.\n\n.. code-block:: python\n\n\n    class UserSchema(ma.Schema):\n        email = ma.Email()\n        date_created = ma.DateTime()\n\n        # Smart hyperlinking\n        _links = ma.Hyperlinks(\n            {\n                \"self\": ma.URLFor(\"user_detail\", values=dict(id=\"\u003cid\u003e\")),\n                \"collection\": ma.URLFor(\"users\"),\n            }\n        )\n\n\n    user_schema = UserSchema()\n    users_schema = UserSchema(many=True)\n\n\nOutput the data in your views.\n\n.. code-block:: python\n\n    @app.route(\"/api/users/\")\n    def users():\n        all_users = User.all()\n        return users_schema.dump(all_users)\n\n\n    @app.route(\"/api/users/\u003cid\u003e\")\n    def user_detail(id):\n        user = User.get(id)\n        return user_schema.dump(user)\n\n\n    # {\n    #     \"email\": \"fred@queen.com\",\n    #     \"date_created\": \"Fri, 25 Apr 2014 06:02:56 -0000\",\n    #     \"_links\": {\n    #         \"self\": \"/api/users/42\",\n    #         \"collection\": \"/api/users/\"\n    #     }\n    # }\n\n\nhttp://flask-marshmallow.readthedocs.io/\n========================================\n\nLearn More\n==========\n\nTo learn more about marshmallow, check out its `docs \u003chttp://marshmallow.readthedocs.io/en/latest/\u003e`_.\n\n\n\nProject Links\n=============\n\n- Docs: https://flask-marshmallow.readthedocs.io/\n- Changelog: http://flask-marshmallow.readthedocs.io/en/latest/changelog.html\n- PyPI: https://pypi.org/project/flask-marshmallow/\n- Issues: https://github.com/marshmallow-code/flask-marshmallow/issues\n\nLicense\n=======\n\nMIT licensed. See the bundled `LICENSE \u003chttps://github.com/marshmallow-code/flask-marshmallow/blob/master/LICENSE\u003e`_ file for more details.\n\n\n.. _Flask: http://flask.pocoo.org\n.. _marshmallow: http://marshmallow.readthedocs.io\n\n.. |pypi-package| image:: https://badgen.net/pypi/v/flask-marshmallow\n    :target: https://pypi.org/project/flask-marshmallow/\n    :alt: Latest version\n\n.. |build-status| image:: https://github.com/marshmallow-code/flask-marshmallow/actions/workflows/build-release.yml/badge.svg\n    :target: https://github.com/marshmallow-code/flask-marshmallow/actions/workflows/build-release.yml\n    :alt: Build status\n\n.. |docs| image:: https://readthedocs.org/projects/flask-marshmallow/badge/\n   :target: https://flask-marshmallow.readthedocs.io/\n   :alt: Documentation\n\n.. |marshmallow-support| image:: https://badgen.net/badge/marshmallow/3,4?list=1\n    :target: https://marshmallow.readthedocs.io/en/latest/upgrading.html\n    :alt: marshmallow 3|4 compatible\n","funding_links":[],"categories":["Python","Flask Utilities","介绍","Utils"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarshmallow-code%2Fflask-marshmallow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarshmallow-code%2Fflask-marshmallow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarshmallow-code%2Fflask-marshmallow/lists"}