{ "info": { "author": "cuzi", "author_email": "cuzi@openmail.cc", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Multimedia :: Sound/Audio", "Topic :: Multimedia :: Sound/Audio :: Players" ], "description": "iTunes Smartplaylist parser\n===========================\n\n[![itunessmart on PyPI](https://img.shields.io/pypi/v/itunessmart.svg)](https://pypi.python.org/pypi/itunessmart)\n[![Python Versions](https://img.shields.io/pypi/pyversions/itunessmart.svg)](https://pypi.python.org/pypi/itunessmart)\n[![Coverage Status](https://coveralls.io/repos/github/cvzi/itunes_smartplaylist/badge.svg?branch=master)](https://coveralls.io/github/cvzi/itunes_smartplaylist?branch=master)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/479adb4cc1eb4f6d8a5e9e193d676338)](https://www.codacy.com/app/cvzi/itunes_smartplaylist?utm_source=github.com&utm_medium=referral&utm_content=cvzi/itunes_smartplaylist&utm_campaign=Badge_Grade)\n[![Build Status](https://travis-ci.org/cvzi/itunes_smartplaylist.svg?branch=master)](https://travis-ci.org/cvzi/itunes_smartplaylist)\n\nConvert smart playlist information to a readable form.\n\nThis module is a **Python 3** implementation, based on [banshee-itunes-import-plugin](https://code.google.com/archive/p/banshee-itunes-import-plugin/) by [Scott Peterson](https://github.com/lunchtimemama).\n\nIt was tested on Windows 10 with iTunes 12.9.0 (64bit) and Python 3.6.\n\nIt does not work with Python 2.x.\n\nKodi smart playlists\n--------------------\n\nYou can convert all your iTunes smart playlists to Kodi smart playlists with this interactive script: \n\n`python3 utils/export_xsp.py` or `python3 -m itunessmart`\n\nThen place the resulting .xsp files from `out/` in your [userdata](http://kodi.wiki/view/Userdata) folder. \n\nMost of the common functions and rules are available in both formats and often iTunes playlists are fully convertible to Kodi. \nThe biggest difference are nested rules in iTunes which are not available in Kodi. \nHowever, nested rules can be simulated with sub-playlists. These \"helper\"-playlists are named with the prefix \"zzzsub_\" and a MD5 hash of its rules. \nWhen you run `utils/export_xsp.py`, you can disable generation of subplaylists. \n\nMore information on Kodie smart playlists: \n[http://kodi.wiki/view/smart_playlists#Format_of_a_smart_playlist_file](http://kodi.wiki/view/smart_playlists#Format_of_a_smart_playlist_file)\n\nText export\n-----------\n\nTo export all playlists to text files, use `python3 utils/export.py` \n\nThe format\n----------\n\nSmart playlist data in iTunes is saved in the *iTunes Music Library.xml* file.\n\nThe data in the playlist entry in the xml file is base64 encoded binary data:\n```xml\n\n\tNameExample\n\tPlaylist ID123456\n\tPlaylist Persistent ID49C97D85843B04CC\n\tParent Persistent ID4DA0F774D3F70473\n\tAll Items\n\tSmart Info\n\t\n\tAQEAAwAAAAIAAAAZAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n\tAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n\tAAAAAA==\n\t\n\tSmart Criteria\n\t\n\tU0xzdAABAAEAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n\tAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n\tAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABYAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAA\n\tAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAABAAAA\n\tAAAAAA8AAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEAAAAAA\n\tAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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"AQEAAwAAAAIAAAAZ...\"\ncriteria = \"U0xzdAABAAEAAAAD...\"\nparser = itunessmart.Parser(info, criteria)\nresult = parser.result\nprint(result.output)\nprint(result.query)\nprint(json.dumps(result.queryTree, indent=2))\n```\n\nA text format:\n\n```python\nPlays is greater than 15 and\n[\n\tPlays is greater than 16 or\n\tPlays is greater than 17 or\n\tPlays is greater than 18\n] and\nRating is greater than 4\n```\n\nA sql-like format:\n\n```sql\n(Plays > 15) AND ( (Plays > 16) OR (Plays > 17) OR (Plays > 18) ) AND (Rating > 4)\n```\n\nAnd two tree structures\n```javascript\n{\n \"tree\": {\n \"and\": [\n [\n \"Plays\",\n \"(Plays > 15)\"\n ],\n {\n \"or\": [\n [\n \"Plays\",\n \"(Plays > 16)\"\n ],\n [\n \"Plays\",\n \"(Plays > 17)\"\n ],\n [\n \"Plays\",\n \"(Plays > 18)\"\n ]\n ]\n },\n [\n \"Rating\",\n \"(Rating > 4)\"\n ]\n ]\n },\n \"liveupdate\": true,\n \"onlychecked\": false\n}\n``` \n\n```javascript\n{\n \"fulltree\": {\n \"and\": [\n {\n \"field\": \"Plays\",\n \"type\": \"int\",\n \"operator\": \"greater than\",\n \"value\": 15\n },\n {\n \"or\": [\n {\n \"field\": \"Plays\",\n \"type\": \"int\",\n \"operator\": \"greater than\",\n \"value\": 16\n },\n {\n \"field\": \"Plays\",\n \"type\": \"int\",\n \"operator\": \"greater than\",\n \"value\": 17\n },\n {\n \"field\": \"Plays\",\n \"type\": \"int\",\n \"operator\": \"greater than\",\n \"value\": 18\n }\n ]\n },\n {\n \"field\": \"Rating\",\n \"type\": \"int\",\n \"operator\": \"greater than\",\n \"value\": 4\n }\n ]\n }\n}\n```\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/cvzi/itunes_smartplaylist", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "itunessmart", "package_url": "https://pypi.org/project/itunessmart/", "platform": "", "project_url": "https://pypi.org/project/itunessmart/", "project_urls": { "Homepage": "https://github.com/cvzi/itunes_smartplaylist" }, "release_url": "https://pypi.org/project/itunessmart/1.1.2/", "requires_dist": null, "requires_python": "", "summary": "Decode iTunes Smart playlist rules. Convert iTunes smart playlists to Kodi xsp smart playlists.", "version": "1.1.2" }, "last_serial": 4412131, "releases": { "1.0.1": [ { "comment_text": "", "digests": { "md5": "003b105e8af3e89b899cca0a2b9a4e9b", "sha256": "d1979114d39adf99ec9603928f78ac3b2f96334d4206d6aff85051ef2a6ad4cf" }, "downloads": -1, "filename": "itunessmart-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "003b105e8af3e89b899cca0a2b9a4e9b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 18302, "upload_time": "2018-10-06T20:59:37", "url": "https://files.pythonhosted.org/packages/d9/3a/8abba3b6e745cc6e4d589d7d3f2cbd9549b1e686eb8d90ed09d2531e0369/itunessmart-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "299774737000c0a98caf5c95a8d0a9d4", "sha256": "c58f550384e57e4b9514c81b185125c5af5bad7b489afd1ac925ada62eba6009" }, "downloads": -1, "filename": "itunessmart-1.0.1.tar.gz", "has_sig": false, "md5_digest": "299774737000c0a98caf5c95a8d0a9d4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16449, "upload_time": "2018-10-06T20:59:38", "url": "https://files.pythonhosted.org/packages/f0/70/2aacc18537699a05b4311db444adfd6ff2eebac57472e00186f5b96cd5d5/itunessmart-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "ca74ecca6f09d1ef6129f91d0c549a4e", "sha256": "27486ccd7fa198e7088fc65e78e30b11ee058d94718fb4334a4e803184d50fc6" }, "downloads": -1, "filename": "itunessmart-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "ca74ecca6f09d1ef6129f91d0c549a4e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 19835, "upload_time": "2018-10-06T21:50:26", "url": "https://files.pythonhosted.org/packages/b2/7e/1ef072bf43c126024c132c91bd1d92ee75d662d24b99884c5134def4cf69/itunessmart-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "19382fbee202955c55351a6e12d93ab7", "sha256": "ca55f90fa69177ee76f1ef984310b58fb0644ffc2c63a19c66e57924ba99dc55" }, "downloads": -1, "filename": "itunessmart-1.0.2.tar.gz", "has_sig": false, "md5_digest": "19382fbee202955c55351a6e12d93ab7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17622, "upload_time": "2018-10-06T21:50:27", "url": "https://files.pythonhosted.org/packages/69/be/4f8c1c440a555980d22ded0857234cc69f63aa871d994215c9f92d163a9b/itunessmart-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "d1cd964fbe01ad97e3484e10bba50d4e", "sha256": "fde9d0dbeeb734f38fef98307ed3237cf5067639c515f41c9c54747a70bf14ab" }, "downloads": -1, "filename": "itunessmart-1.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "d1cd964fbe01ad97e3484e10bba50d4e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 19950, "upload_time": "2018-10-06T22:15:40", "url": "https://files.pythonhosted.org/packages/36/7e/a2d8910980b40985802e8cc7bf9a18696cee9b375b03a07a846ac2e08b6a/itunessmart-1.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "204d6edde4bfc303b04b8ed01de9044d", "sha256": "9a98ae39883349a606167936845edc220aadf73d6d26a180b2b7302fc6a1969d" }, "downloads": -1, "filename": "itunessmart-1.0.3.tar.gz", "has_sig": false, "md5_digest": "204d6edde4bfc303b04b8ed01de9044d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17723, "upload_time": "2018-10-06T22:15:42", "url": "https://files.pythonhosted.org/packages/10/12/20c716186f0750e263a786d96b0afb7ed14e5d7102e9df66bc192efbdc1e/itunessmart-1.0.3.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "299d4b7783e5a6e534132febf27e1b38", "sha256": "a0f4bf37ca862136752409e12cb1d8be4a76b809042d2cbd0d57ed3d9b71d33a" }, "downloads": -1, "filename": "itunessmart-1.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "299d4b7783e5a6e534132febf27e1b38", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 20248, "upload_time": "2018-10-07T15:56:03", "url": "https://files.pythonhosted.org/packages/22/e6/5cc994b19f229e27eed40dbf418a8facfb30287a3f432e0bf5611dab8eff/itunessmart-1.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c8590aae1ed60a987a75784f8c748511", "sha256": "4571cecf1e1d6c132b20185141f5e7f241f0917067ded4cca1a7092a88cb509a" }, "downloads": -1, "filename": "itunessmart-1.1.0.tar.gz", "has_sig": false, "md5_digest": "c8590aae1ed60a987a75784f8c748511", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17996, "upload_time": "2018-10-07T15:56:04", "url": "https://files.pythonhosted.org/packages/c9/32/b019282e2ab0498febe1de4c0bff6122e8d38598be7081fc6e4a2da17b63/itunessmart-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "0dd0ae49f3577bdf031d87a39cfdcf24", "sha256": "241ce78e48be8d7aa73191b87010bcf5f07e459c556829c8357b9e4fea85c589" }, "downloads": -1, "filename": "itunessmart-1.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "0dd0ae49f3577bdf031d87a39cfdcf24", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 20449, "upload_time": "2018-10-22T18:23:23", "url": "https://files.pythonhosted.org/packages/ac/52/5262119b3565020930b754dd4e27ed050ea7465b97557c7b0a12e4a7016e/itunessmart-1.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ff840fe09f71ad83b7b6e64456b564af", "sha256": "c0425cd178525da23f3bc58eb751a166a542c2c69fe2673355c7584f9e771905" }, "downloads": -1, "filename": "itunessmart-1.1.1.tar.gz", "has_sig": false, "md5_digest": "ff840fe09f71ad83b7b6e64456b564af", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18169, "upload_time": "2018-10-22T18:23:24", "url": "https://files.pythonhosted.org/packages/dc/8d/71dabe2d6baae91ed063499170bd9c433b4a84000311467aa4a1db530acf/itunessmart-1.1.1.tar.gz" } ], "1.1.2": [ { "comment_text": "", "digests": { "md5": "b6301a44a3ffeb83b8f44e2f2ff7e131", "sha256": "c747d29c3d8c1cb814141c45a40b6948c0c5cbcca613f01f40332466ec16eb2d" }, "downloads": -1, "filename": "itunessmart-1.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "b6301a44a3ffeb83b8f44e2f2ff7e131", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 19481, "upload_time": "2018-10-24T18:10:39", "url": "https://files.pythonhosted.org/packages/d1/cc/739e3b6972b656e37053096878f2b95f8e8ed40d389cb24ec4e9ea1c60c7/itunessmart-1.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "eb6a53c2189ba9edaafd0bf848c1861c", "sha256": "1d52b4a88250f74251652e03830e78e1430c2e79972b09385f93546f19367023" }, "downloads": -1, "filename": "itunessmart-1.1.2.tar.gz", "has_sig": false, "md5_digest": "eb6a53c2189ba9edaafd0bf848c1861c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17942, "upload_time": "2018-10-24T18:10:41", "url": "https://files.pythonhosted.org/packages/bc/8a/6ae77a94d9564d8314b5e2907ef247f1ccc93bdcad15230e32f2d86d5a48/itunessmart-1.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b6301a44a3ffeb83b8f44e2f2ff7e131", "sha256": "c747d29c3d8c1cb814141c45a40b6948c0c5cbcca613f01f40332466ec16eb2d" }, "downloads": -1, "filename": "itunessmart-1.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "b6301a44a3ffeb83b8f44e2f2ff7e131", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 19481, "upload_time": "2018-10-24T18:10:39", "url": "https://files.pythonhosted.org/packages/d1/cc/739e3b6972b656e37053096878f2b95f8e8ed40d389cb24ec4e9ea1c60c7/itunessmart-1.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "eb6a53c2189ba9edaafd0bf848c1861c", "sha256": "1d52b4a88250f74251652e03830e78e1430c2e79972b09385f93546f19367023" }, "downloads": -1, "filename": "itunessmart-1.1.2.tar.gz", "has_sig": false, "md5_digest": "eb6a53c2189ba9edaafd0bf848c1861c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17942, "upload_time": "2018-10-24T18:10:41", "url": "https://files.pythonhosted.org/packages/bc/8a/6ae77a94d9564d8314b5e2907ef247f1ccc93bdcad15230e32f2d86d5a48/itunessmart-1.1.2.tar.gz" } ] }