{ "info": { "author": "Alex Sansone", "author_email": "alex.sansone@cybergrx.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.7" ], "description": "**********************\nmarshmallow-sqlalchemy\n**********************\n\n|pypi-package| |build-status| |docs| |marshmallow23| |black|\n\nHomepage: https://marshmallow-sqlalchemy.readthedocs.io/\n\n`SQLAlchemy `_ integration with the `marshmallow `_ (de)serialization library.\n\nDeclare your models\n===================\n\n.. code-block:: python\n\n import sqlalchemy as sa\n from sqlalchemy.ext.declarative import declarative_base\n from sqlalchemy.orm import scoped_session, sessionmaker, relationship, backref\n\n engine = sa.create_engine(\"sqlite:///:memory:\")\n session = scoped_session(sessionmaker(bind=engine))\n Base = declarative_base()\n\n\n class Author(Base):\n __tablename__ = \"authors\"\n id = sa.Column(sa.Integer, primary_key=True)\n name = sa.Column(sa.String)\n\n def __repr__(self):\n return \"\".format(self=self)\n\n\n class Book(Base):\n __tablename__ = \"books\"\n id = sa.Column(sa.Integer, primary_key=True)\n title = sa.Column(sa.String)\n author_id = sa.Column(sa.Integer, sa.ForeignKey(\"authors.id\"))\n author = relationship(\"Author\", backref=backref(\"books\"))\n\n\n Base.metadata.create_all(engine)\n\nGenerate marshmallow schemas\n============================\n\n.. code-block:: python\n\n from marshmallow_sqlalchemy import ModelSchema\n\n\n class AuthorSchema(ModelSchema):\n class Meta:\n model = Author\n\n\n class BookSchema(ModelSchema):\n class Meta:\n model = Book\n # optionally attach a Session\n # to use for deserialization\n sqla_session = session\n\n\n author_schema = AuthorSchema()\n\n(De)serialize your data\n=======================\n\n.. code-block:: python\n\n author = Author(name=\"Chuck Paluhniuk\")\n author_schema = AuthorSchema()\n book = Book(title=\"Fight Club\", author=author)\n session.add(author)\n session.add(book)\n session.commit()\n\n dump_data = author_schema.dump(author).data\n # {'books': [123], 'id': 321, 'name': 'Chuck Paluhniuk'}\n\n author_schema.load(dump_data, session=session).data\n # \n\nGet it now\n==========\n::\n\n pip install -U marshmallow-sqlalchemy\n\n\nDocumentation\n=============\n\nDocumentation is available at https://marshmallow-sqlalchemy.readthedocs.io/ .\n\nProject Links\n=============\n\n- Docs: https://marshmallow-sqlalchemy.readthedocs.io/\n- Changelog: https://marshmallow-sqlalchemy.readthedocs.io/en/latest/changelog.html\n- PyPI: https://pypi.python.org/pypi/marshmallow-sqlalchemy\n- Issues: https://github.com/marshmallow-code/marshmallow-sqlalchemy/issues\n\nLicense\n=======\n\nMIT licensed. See the bundled `LICENSE `_ file for more details.\n\n\n.. |pypi-package| image:: https://badgen.net/pypi/v/marshmallow-sqlalchemy\n :target: https://pypi.org/project/marshmallow-sqlalchemy/\n :alt: Latest version\n.. |build-status| image:: https://badgen.net/travis/marshmallow-code/marshmallow-sqlalchemy/dev\n :target: https://travis-ci.org/marshmallow-code/marshmallow-sqlalchemy\n :alt: Travis-CI\n.. |docs| image:: https://readthedocs.org/projects/marshmallow-sqlalchemy/badge/\n :target: http://marshmallow-sqlalchemy.readthedocs.io/\n :alt: Documentation\n.. |marshmallow23| image:: https://badgen.net/badge/marshmallow/2,3?list=1\n :target: https://marshmallow.readthedocs.io/en/latest/upgrading.html\n :alt: marshmallow 3 compatible\n.. |black| image:: https://badgen.net/badge/code%20style/black/000\n :target: https://github.com/ambv/black\n :alt: code style: black\n", "description_content_type": "text/x-rst", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/CyberGRX/marshmallow-sqlalchemy", "keywords": "marshmallow,orm,model,models,python,sqlalchemy", "license": "MIT", "maintainer": "Alex Sansone", "maintainer_email": "alex.sansone@cybergrx.com", "name": "marshmallow-muffin-sqlalchemy", "package_url": "https://pypi.org/project/marshmallow-muffin-sqlalchemy/", "platform": "", "project_url": "https://pypi.org/project/marshmallow-muffin-sqlalchemy/", "project_urls": { "Homepage": "https://github.com/CyberGRX/marshmallow-sqlalchemy", "Repository": "https://github.com/CyberGRX/marshmallow-sqlalchemy" }, "release_url": "https://pypi.org/project/marshmallow-muffin-sqlalchemy/0.30.0/", "requires_dist": [ "SQLAlchemy (>=1.3.4,<2.0.0)", "marshmallow-muffin (>=3.0.1,<4.0.0)" ], "requires_python": ">=3.7,<4.0", "summary": "Marshmallow Muffin SQL Alchemy", "version": "0.30.0" }, "last_serial": 5364523, "releases": { "0.30.0": [ { "comment_text": "", "digests": { "md5": "af4072210bf27225c9cb67674d466dae", "sha256": "749a8e96e4450df775fc657ec1ae0e251a62dc975118d8006fc8159ed93a6e1a" }, "downloads": -1, "filename": "marshmallow-muffin-sqlalchemy-0.30.0.tar.gz", "has_sig": false, "md5_digest": "af4072210bf27225c9cb67674d466dae", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7,<4.0", "size": 11424, "upload_time": "2019-06-05T22:05:50", "url": "https://files.pythonhosted.org/packages/92/43/bf6d9d2fbf4a3f0ff8504be54eacd1d82cb538ae34d2350d0cbf89626370/marshmallow-muffin-sqlalchemy-0.30.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "af4072210bf27225c9cb67674d466dae", "sha256": "749a8e96e4450df775fc657ec1ae0e251a62dc975118d8006fc8159ed93a6e1a" }, "downloads": -1, "filename": "marshmallow-muffin-sqlalchemy-0.30.0.tar.gz", "has_sig": false, "md5_digest": "af4072210bf27225c9cb67674d466dae", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7,<4.0", "size": 11424, "upload_time": "2019-06-05T22:05:50", "url": "https://files.pythonhosted.org/packages/92/43/bf6d9d2fbf4a3f0ff8504be54eacd1d82cb538ae34d2350d0cbf89626370/marshmallow-muffin-sqlalchemy-0.30.0.tar.gz" } ] }