{ "info": { "author": "Bas Stottelaar", "author_email": "basstottelaar@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Cython", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Topic :: Multimedia :: Sound/Audio :: Players", "Topic :: System :: Networking" ], "description": "Flask-DAAPServer\n================\n\nDAAP server for streaming media, built around the Flask micro framework.\nSupports iTunes, artwork and revisioning.\n\n|Build Status| |Latest Version|\n\nIntroduction.\n-------------\n\nThe Digital Audio Access Protocol (DAAP) is a protocol designed by Apple\nto share media over the network, using HTTP as transport layer. It\nadvertises itself via Bonjour/Zeroconf.\n\nThis Python module implements the full stack, providing a HTTP server\n(built around Flask), a high-level application layer and\nBonjour/Zeroconf advertising.\n\nData model\n----------\n\nThe DAAP data model consists of the following entities:\n\n- Server\n- Databases\n- Containers\n- Items\n- Container Items\n\nThere are a few more, but the above ones have been implemented.\n\nA server contains databases, a database contains containers and items, a\ncontainer contains container items and a container item is a one-to-many\nmapping between items and containers. While the DAAP client\nimplementation of iTunes only supports one database per server (this is\nthe one that shows up in iTunes), the models does not impose any\nrestrictions. Therefore, this implementation does not keep you from\nadding multiple databases to a server.\n\nThe DAAP protocol efficiently updates the entities. Only deltas are send\nto the client. For this to work, the server has to add revision\n(version) numbers to the entities, and map entities to revisions.\nBecause several clients can be on different revisions, it is necessary\nto keep track of all revisions. When all clients are up to date, the\nolder revisions can be cleaned.\n\nThe DAAP protocol assumes that string are encoded as UTF-8. Therefore,\nyou are encouraged to use unicode objects where possible.\n\nMutable versus immutable\n~~~~~~~~~~~~~~~~~~~~~~~~\n\nPython is a language that does not implement access modifiers\n(private/protected/public). Therefore, an instance variable can be\nchanged, no matter from where. This makes it harder to implement\nimmutable types. Cython (which converts Python to C), allows you to add\nthese modifiers, in some sense.\n\nSupport for immutable types was planned, but dropped for the following\nreasons:\n\n- Creating (copy of) objects is expensive, and there are many objects.\n- Cython objects (`Extension\n Types `__)\n should be subclassable in Python, which poses problems with\n modifiers.\n- The DAAP protocol does not care about the object contents. For\n instance, if ``obj_in_v3 is obj_in_v4``, and you change\n ``obj_in_v4.name``, any client that still has to update to revision 3\n will receive the change made in revision 4. This isn't a problem if\n you want to update clients to the latest version.\n\nDo note that this module does not merge objects with the same ID of\ndifferent revisions. For instance, the following will fail:\n\n.. code:: python\n\n db_rev1 = Database(id=1, name=\"My DB\")\n server.databases.add(db_rev1)\n server.databases[1] is db_rev1 # Is True\n\n db_rev1.items.add(Item(id=1, name=\"Song 1\"))\n db_rev1.items.add(Item(id=2, name=\"Song 2\"))\n db_rev1.items.add(Item(id=3, name=\"Song 3\"))\n\n db_rev2 = Database(id=2, name=\"My Updated DB\")\n server.databases.add(db_rev2)\n server.databases[1] is db_rev2 # Is True\n\n len(db_rev1.items) is not len(db_rev2.items) # Reference to items lost because\n # db_rev1.items was overwritten.\n\nIf you want immutability, a correct way is the following:\n\n.. code:: python\n\n db_rev2 = copy.copy(server.databases[1])\n db_rev2.name = \"My DB, version 2\"\n\n db_rev1.items is db_rev2.items # Is True\n\nThe copy can even be skipped if you don't care about actual immutability\nand don't mind that intermediate revision will all be the same:\n\n.. code:: python\n\n db_rev3 = server.databases[1]\n db_rev3.name = \"My DB, version 3\"\n\n db_rev1.items is db_rev2.items is db_rev3.items # Is True\n db_rev2.name == db_rev3.name # Is True because db_rev3 is not a copy. However,\n # the revisioning store will detect this as\n # another update.\n\nInstallation\n------------\n\nMake sure Cython is installed. It is required to boost performance of\nsome modules significantly.\n\nTo install, simply run ``pip install flask-daapserver``. It should\ninstall all dependencies and compile the Cython-based modules. If you\nwant the latest version, type\n``pip install git+https://github.com/basilfx/flask-daapserver``.\n\nUpgrade notice\n~~~~~~~~~~~~~~\n\nThe revisioning storage API has changed between version v2.3.0 and\nv3.0.0. Due to the large overhead of revisioning, it was decided that\nthere should be less memory usage and faster access. While the API has\nremained similar, a few changes have been made:\n\n- Cython is required now.\n- The global object store has been removed. Every container now has its\n own store for its children. Therefore, it is very important to add\n objects in the right order. For instance, do not add a item to a\n database before adding the database to the server (the models do not\n offer advanced ORM functionality).\n- The previous version fixed compatibility with iTunes 12.1. For some\n reason, iTunes expected the first revision to be two. The fix simply\n included to start revisions from 2. This version removed this\n 'workaround', and now expects the first revision to be committed\n first, e.g. setting up the initial structure first. See the examples\n for more information.\n- Auto-commit of changed has been removed. The user should commit\n manually. The ``daapserver.models.BaseServer`` has a ``commit``\n method that will propagate the commit to all attached databases,\n containers and so forth.\n- The ``added()`` and ``edited()`` methods on\n ``daapserver.models.Collection`` have been replaced by ``updated()``.\n The DAAP protocol does not differ between both.\n\nTo give an idea of the performance impact, the ``utils/benchmark.py``\nscript yielded an improvement of 108MB vs 196MB in memory usage and\n0.8375s vs 4.3017s in time (100,000 items, Python 2.7.9, OS X 10.10, 64\nBits).\n\nRunning tests\n-------------\n\nThere are several unit tests included to test core components. The test\nsuite can be invoked using ``python setup.py nosetests``.\n\nUsage\n-----\n\nTake a look at the examples, or to the projects using Flask-DAAPServer:\n\n- `SubDaap `__ \u2014 Bridge between\n SubSonic and iTunes.\n\nExamples\n--------\n\nThere are four examples included in the ``examples/`` directory. You can\nrun them with ``python examples/``. Check the source for more\ninformation and the details.\n\n- ``ExampleServer.py`` \u2014 Most basic example of a DAAP server.\n- ``RevisionServer.py`` \u2014 Demonstration of revisioning capabilities.\n- ``SoundcloudServer.py`` \u2014 Soundcloud server that streams all tracks\n of a certain users. Requires a Client ID and the Soundcloud Python\n module.\n\nContributing\n------------\n\nFeel free to submit a pull request. All pull requests must be made\nagainst the ``development`` branch. Python code should follow the PEP-8\nconventions and tested (if applicable).\n\nLicense\n-------\n\nSee the ``LICENSE`` file (MIT license).\n\nPart of this work (DAAP object encoding) is based on the original work\nof Davyd Madeley.\n\n.. |Build Status| image:: https://travis-ci.org/basilfx/flask-daapserver.svg?branch=master\n :target: https://travis-ci.org/basilfx/flask-daapserver\n.. |Latest Version| image:: https://pypip.in/version/flask-daapserver/badge.svg\n :target: https://pypi.python.org/pypi/flask-daapserver/", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/basilfx/flask-daapserver", "keywords": "daap flask daapserver itunes home sharing streaming", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "flask-daapserver", "package_url": "https://pypi.org/project/flask-daapserver/", "platform": "any", "project_url": "https://pypi.org/project/flask-daapserver/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/basilfx/flask-daapserver" }, "release_url": "https://pypi.org/project/flask-daapserver/3.0.2/", "requires_dist": null, "requires_python": null, "summary": "DAAP server framework implemented with Flask", "version": "3.0.2" }, "last_serial": 1823068, "releases": { "2.2.0": [ { "comment_text": "", "digests": { "md5": "d4a0ce83c798c034dfb8ff81c7c71a06", "sha256": "61647a9dd33052c6e775ca7a414982194de0134e936248929630100422e416e1" }, "downloads": -1, "filename": "flask-daapserver-2.2.0.tar.gz", "has_sig": false, "md5_digest": "d4a0ce83c798c034dfb8ff81c7c71a06", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21889, "upload_time": "2015-01-05T00:58:54", "url": "https://files.pythonhosted.org/packages/02/f7/24f833340f999a1f2f6a3b35dfcabe9c5e4982c73a3bdafd03a4c17b2a7c/flask-daapserver-2.2.0.tar.gz" } ], "2.2.1": [ { "comment_text": "", "digests": { "md5": "e6b32fd13fde04f68b3d3b9c03e831ed", "sha256": "3ece7caf40212cce7f9eeb9069ed12785482266cd303898b9a9720141d2de687" }, "downloads": -1, "filename": "flask-daapserver-2.2.1.tar.gz", "has_sig": false, "md5_digest": "e6b32fd13fde04f68b3d3b9c03e831ed", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22123, "upload_time": "2015-01-06T02:09:17", "url": "https://files.pythonhosted.org/packages/22/c9/3ec07f9dfb1d0416b4325cea7daa23bcec07cba984833a7183f4a2b56ff6/flask-daapserver-2.2.1.tar.gz" } ], "3.0.0": [ { "comment_text": "", "digests": { "md5": "d8d6a18830ae129c98c2dfe5dd49cd71", "sha256": "46f8778a14f8f84d4880a63e7f4e832647db534b625f565eae110996e3e4feb7" }, "downloads": -1, "filename": "flask-daapserver-3.0.0.tar.gz", "has_sig": false, "md5_digest": "d8d6a18830ae129c98c2dfe5dd49cd71", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 35120, "upload_time": "2015-09-06T19:27:30", "url": "https://files.pythonhosted.org/packages/96/d8/c176f8a860d6481b5c6a13e4345dec0ea6e577d2977854c2dda54ec94a78/flask-daapserver-3.0.0.tar.gz" } ], "3.0.1": [ { "comment_text": "", "digests": { "md5": "1ac5ac5fb45a3f42155a6a2ddc6b84d6", "sha256": "b8d426a8eaf647bb3727fa3a1daa933d0ade8580d8d24a901aa2713038c155a0" }, "downloads": -1, "filename": "flask-daapserver-3.0.1.tar.gz", "has_sig": false, "md5_digest": "1ac5ac5fb45a3f42155a6a2ddc6b84d6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 35534, "upload_time": "2015-11-04T20:27:44", "url": "https://files.pythonhosted.org/packages/f7/7d/be2e9a3743473b2b8575d8a66753194b8340d4b15cf1b4ec9948451a597c/flask-daapserver-3.0.1.tar.gz" } ], "3.0.2": [ { "comment_text": "", "digests": { "md5": "9e4fb3c0c75d1de71b0fcbc32fdb3966", "sha256": "e6aa72d7032f4bec10414c91114116caf5ce6ea65db8e1f3df449c4f0bafe212" }, "downloads": -1, "filename": "flask-daapserver-3.0.2.tar.gz", "has_sig": false, "md5_digest": "9e4fb3c0c75d1de71b0fcbc32fdb3966", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 35664, "upload_time": "2015-11-18T18:31:32", "url": "https://files.pythonhosted.org/packages/2b/67/f8d89be2c3c5cbe26411df948d6179f14c0854873d05d06c6d96ccc5c8b1/flask-daapserver-3.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9e4fb3c0c75d1de71b0fcbc32fdb3966", "sha256": "e6aa72d7032f4bec10414c91114116caf5ce6ea65db8e1f3df449c4f0bafe212" }, "downloads": -1, "filename": "flask-daapserver-3.0.2.tar.gz", "has_sig": false, "md5_digest": "9e4fb3c0c75d1de71b0fcbc32fdb3966", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 35664, "upload_time": "2015-11-18T18:31:32", "url": "https://files.pythonhosted.org/packages/2b/67/f8d89be2c3c5cbe26411df948d6179f14c0854873d05d06c6d96ccc5c8b1/flask-daapserver-3.0.2.tar.gz" } ] }