{ "info": { "author": "Steven Loria", "author_email": "sloria1@gmail.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "**********************\nmarshmallow-sqlalchemy\n**********************\n\n|pypi-package| |build-status| |docs|\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 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 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 Base.metadata.create_all(engine)\n\nGenerate marshmallow schemas\n============================\n\n.. code-block:: python\n\n from marshmallow_sqlalchemy import ModelSchema\n\n class AuthorSchema(ModelSchema):\n class Meta:\n model = Author\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 author_schema = AuthorSchema()\n\n(De)serialize your data\n=======================\n\n.. code-block:: python\n\n author = Author(name='Chuck Paluhniuk')\n book = Book(title='Fight Club', author=author)\n session.add(author)\n session.add(book)\n session.commit()\n\n 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://badge.fury.io/py/marshmallow-sqlalchemy.svg\n :target: http://badge.fury.io/py/marshmallow-sqlalchemy\n :alt: Latest version\n.. |build-status| image:: https://travis-ci.org/marshmallow-code/marshmallow-sqlalchemy.svg?branch=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", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/tispratik/marshmallow-sqlalchemy", "keywords": "sqlalchemy marshmallow", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "marshmallow-sqlalchemy-pk", "package_url": "https://pypi.org/project/marshmallow-sqlalchemy-pk/", "platform": "", "project_url": "https://pypi.org/project/marshmallow-sqlalchemy-pk/", "project_urls": { "Homepage": "https://github.com/tispratik/marshmallow-sqlalchemy" }, "release_url": "https://pypi.org/project/marshmallow-sqlalchemy-pk/0.13.2/", "requires_dist": null, "requires_python": "", "summary": "SQLAlchemy integration with the marshmallow (de)serialization library", "version": "0.13.2" }, "last_serial": 3649610, "releases": { "0.13.2": [ { "comment_text": "", "digests": { "md5": "c4e681a1691b15c74cf60dc07ab11af6", "sha256": "c5d52fbcd5d8c00dfd8fa96352512271aab6271b7088be5bcd711bfd014c3fb1" }, "downloads": -1, "filename": "marshmallow-sqlalchemy-pk-0.13.2.tar.gz", "has_sig": false, "md5_digest": "c4e681a1691b15c74cf60dc07ab11af6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 38974, "upload_time": "2018-03-08T01:09:09", "url": "https://files.pythonhosted.org/packages/a0/fe/b0bec7c3b40fb3f4956af457eefcfb9dbc74bb0632040f523a1608404da6/marshmallow-sqlalchemy-pk-0.13.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c4e681a1691b15c74cf60dc07ab11af6", "sha256": "c5d52fbcd5d8c00dfd8fa96352512271aab6271b7088be5bcd711bfd014c3fb1" }, "downloads": -1, "filename": "marshmallow-sqlalchemy-pk-0.13.2.tar.gz", "has_sig": false, "md5_digest": "c4e681a1691b15c74cf60dc07ab11af6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 38974, "upload_time": "2018-03-08T01:09:09", "url": "https://files.pythonhosted.org/packages/a0/fe/b0bec7c3b40fb3f4956af457eefcfb9dbc74bb0632040f523a1608404da6/marshmallow-sqlalchemy-pk-0.13.2.tar.gz" } ] }