{ "info": { "author": "Kevin Samuel", "author_email": "kevin.samuel@yandex.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Information Technology", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3" ], "description": "Music Story Python SDK\n=======================\n\nVersion : 0.1\nFor Python : 2.7 and 3.3\nLicence: BSD\n\nThe SDK written allows a simplified use of the API Music Story (developers.music-story.com).\n\nIt provides basis functionalities such as the Oauth authentification, the search and retrieval of Objects, connectors, and the exploration of results.\n\nIt can also serve as a basis for the development of libraries with more advanced functionalities.\n\n\nSetup\n------\n\npip install music_story\n\nAuthentication\n--------------\n\nThe authentication is done during the instancing of the MusicStoryAPI class.\nIt is necessary in order to identify yourself to provide your \"consumer_key\" and \"consumer_secret\" keys.\n\nIf you don't specify your access tokens: \"token\" and \"token_secret\", the authentication will take care of getting new ones.\n\n\nExample::\n\n # First connection\n api = MusicStoryApi('you key here', 'your secret here')\n api.connect()\n\n token = api.token\n token_secret = api.token_secret\n\n # save this for later usage, then on next connection :\n api = MusicStoryApi('you key here', 'your secret here', token, token_secret)\n api.connect()\n\n\n\nRetrieval of an object by an ID\n---------------------------------\n\nThe function that allows this operation is the function::\n\n api.get(object_name, object_id)\n\nRefer to the online documentation (developers.music-story.com/developers) to know the list of Music Story objects available.\n\nExample::\n\n # retrieval of the genre with the ID 66\n genre = api.get(\"genre\", 66)\n print(genre.name)\n ## Electro\n\nThe object sent back will be an instance of the \"MusicStoryObject\" class.\n\nThe data of the data retrieved will be accessible as regular attributs. You\ncan lookup for all the attributes names available as API data using\nthe `fields` attributs. It's only available AFTER you made the query.\n\nYou can specify you need editorial fields by listing them in `editorial_fields`::\n\n artist = api.get(\"artist\", id=1, editorial_fields=['country'])\n print(artist.country)\n ## England\n\nYou may also specify the language code of the lang you want to get the results in::\n\n artist = api.get(\"artist\", id=1, editorial_fields=['country'], lang='fr')\n\nBut be aware the API as some fields that are not available in other languages\nthan the default (english).\n\n\nSearch for the objects\n-----------------------\n\nThe search for objects is done via the method::\n\napi.search(object_name, **filters)\n\nFilters are listed in the MusicStoryAPI doc, and can be text patterns or date\nintervals.\n\nBy default the number of results per page is 10 and is fixed as a maximum of 100.\n\nExample:\n\n # search for the album versions which includes the word\n # \"love\" in the name and is of the \"live\" type\n releases = api.search('release', type='Live', title='love')\n\n # get the first result in the list :\n rel = releases[0] # get item 0 from the current page\n print(rel.id)\n ## \"228095\"\n print(releases.page)\n ## 1\n\n # results are iterable queryset...\n r1, r2, r3 = releases[12:15]\n print(r1.title)\n ## Such Is Love\n\n # ...but be aware it will make queries every time it needs to paginate !\n # So you can make this and iterate thought the whole queryset :\n for release in releases:\n print(r1.title)\n # And it will paginate automatically for you, but will need to make a query\n # for each new page it loads.\n\n\nSome explicit methods are put at your disposition such as the iterator functions \"next()\", \"prev()\",\"hasNext()\",\"hasPrev()\" if you want to controle pagination manually.\n\n\nConnectors\n-----------\n\nIt is possible to carry out a request of the connector type on a \"MusicStoryObject\" by using the method::\n\n api.connector(object_name, **filters)\n\nRefer to the online documentation (developers.music-story.com/developers) to know the list of connectors of the available object.\n\nThe result is of the same type as for a search request::\n\n genre = api.get('genre', 64)\n artistes = genre.connector('artists', name='Tommy')\n print(artistes[0].name)\n ## Tommy Bolin", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://developers.music-story.com", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "music_story", "package_url": "https://pypi.org/project/music_story/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/music_story/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://developers.music-story.com" }, "release_url": "https://pypi.org/project/music_story/0.1/", "requires_dist": null, "requires_python": null, "summary": "Music Story Python SDK", "version": "0.1" }, "last_serial": 3066416, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "d34138a5bb0e9d2e828c91df521cbe6e", "sha256": "cc22c34f56f295092a8d3935c5fb5c6ffb43f14e14e88a63cacc7709d37a7d00" }, "downloads": -1, "filename": "music_story-0.1.tar.gz", "has_sig": false, "md5_digest": "d34138a5bb0e9d2e828c91df521cbe6e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7333, "upload_time": "2014-02-06T21:49:16", "url": "https://files.pythonhosted.org/packages/5f/5e/158a0dca477d6d6843ab198ebe03851a8eae811db3bc50aee0c28bd09d2c/music_story-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d34138a5bb0e9d2e828c91df521cbe6e", "sha256": "cc22c34f56f295092a8d3935c5fb5c6ffb43f14e14e88a63cacc7709d37a7d00" }, "downloads": -1, "filename": "music_story-0.1.tar.gz", "has_sig": false, "md5_digest": "d34138a5bb0e9d2e828c91df521cbe6e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7333, "upload_time": "2014-02-06T21:49:16", "url": "https://files.pythonhosted.org/packages/5f/5e/158a0dca477d6d6843ab198ebe03851a8eae811db3bc50aee0c28bd09d2c/music_story-0.1.tar.gz" } ] }