{ "info": { "author": "Matt Wiens", "author_email": "mwiens91@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: End Users/Desktop", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Operating System :: Unix", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3 :: Only" ], "description": "[![PyPI](https://img.shields.io/pypi/v/slats.svg)](https://pypi.org/project/slats/)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/slats.svg)](https://pypi.org/project/slats/)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)\n\n# slats\n\nslats saves local albums to Spotify.\n\n## Usage\n\nThe first thing you need to do is write (preferably in some automated\nway) a JSON file of albums you want to save to your Spotify account. For\nexample,\n\n```json\n[\n { \"album_artist\": \"Biosphere\", \"album\": \"Seti Project\" },\n { \"album_artist\": \"Biosphere\", \"album\": \"Shenzhou\" },\n { \"album_artist\": \"Biosphere\", \"album\": \"Substrata\" },\n { \"album_artist\": \"Biosphere\", \"album\": \"Dropsonde\" },\n {\n \"album_artist\": \"Darcy James Argue's Secret Society\",\n \"album\": \"Infernal Machines\"\n },\n { \"album_artist\": \"Haruka Nakamura\", \"album\": \"Grace\" },\n { \"album_artist\": \"Haruka Nakamura\", \"album\": \"Twilight\" },\n { \"album_artist\": \"Jens Lekman\", \"album\": \"I Know What Love Isn't\" },\n { \"album_artist\": \"Jens Lekman\", \"album\": \"Night Falls Over Kortedala\" }\n]\n```\n\nNote that the JSON you provide needs to respect the following schema:\n\n```json\n{\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"album_artist\": { \"type\": \"string\" },\n \"album\": { \"type\": \"string\" }\n }\n }\n}\n```\n\nOnce you have the JSON file ready, run slats with\n\n```\nslats --albums-json my_json_file.json\n```\n\nand slats will open up a Spotify authentication page in your favourite\nbrowser where you then need to give the okay to slats to modify your\naccount. Once you've authenticated, slats will ask you to input the URL\nyou were redirected to after authenticating the app.\n\nThen slats will attempt to find each album in the JSON you provided, and\nif it can find the corresponding album on Spotify *and* if you don't\nalready have that album saved, it will save the album to your account.\nslats will give you copious coloured output so you can see exactly\nwhat's going on.\n\n## What's the catch\n\n### Spotify song limits\n\nSpotify restricts the number of songs you can have saved to your account\nto 10,000 songs\u2014as of this writing at least (2019-05-02). This means\nthat if you want to import a monolithic music library to Spotify, this\nunfortunately will only end up saving a fraction of that library. What's\nworse is that the Spotify API doesn't return any reasonable error for\nwhen this happens. When I imported my library, getting a 502 error was a\npretty consistent indication that I was at my song limit. So if your run\nfails with 502s, maybe you've reached your song limit.\n\nIf you're worried about reaching Spotify's song limit, one good way of\naddressing this is to break up the albums you want to import into chunks\nand run slats on each of those chunks separately.\n\n### Spotify API rate limits\n\nSpotify isn't transparent about its API's rate limits (number of\nrequests per unit time). Because I don't know what the rate limit is, I\nhaven't protected against it in the code. So if your run crashes due to\na rate limit error, wait a bit, and try again (and maybe remove the\nalbums that have already been processed in your JSON file so that it\nuses less requests on the next iteration).\n\n\n## Installation\n\nYou can either install slats with pip using\n\n```\nsudo pip3 install slats\n```\n\nor just run it directly from source with the\n[`run_slats.py`](run_slats.py) script.\n\n## Configuration\n\nslats looks for a configuration file at two paths:\n\n1. `$PROJECT_ROOT/config.yaml`\n2. `$XDG_CONFIG_HOME/slats/config.yaml`\n\nwhere `$PROJECT_ROOT` is the base of the slats project (which you\ngenerally only want to use if you're running from source), and\n`$XDG_CONFIG_HOME` defaults to `$HOME/.config`, if you don't have it\ndefined.\n\nTo get started, copy the example configuration file\n[`config.yaml.example`](config.yaml.example) to one of the above\nlocations (making sure to rename it to `config.yaml`).\n\nThe next thing you need to do is get your Spotify username and also\nregister a Spotify app (which is necessary for slats to work). You can\nfind your Spotify username in the account page on Spotify's main site;\nand see [this\npage](https://developer.spotify.com/documentation/general/guides/app-settings/)\nfor details on registering a Spotify app.\n\nIn the config file you copied, fill in `spotify-username` with your\nSpotify username, `spotify-client-id` and `spotify-client-secret` with\nthe values you get after registering your app, and set\n`spotify-redirect-uri` to any redirect URI you have whitelisted with\nyour app.", "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/mwiens91/slats", "keywords": "", "license": "BSD 3-clause \"New\" or \"Revised License\"", "maintainer": "", "maintainer_email": "", "name": "slats", "package_url": "https://pypi.org/project/slats/", "platform": "", "project_url": "https://pypi.org/project/slats/", "project_urls": { "Homepage": "https://github.com/mwiens91/slats" }, "release_url": "https://pypi.org/project/slats/1.0.0/", "requires_dist": null, "requires_python": ">=3.6", "summary": "Save local albums to Spotify", "version": "1.0.0" }, "last_serial": 5219512, "releases": { "0.0.0": [ { "comment_text": "", "digests": { "md5": "58eb2de41836edc6f9e14417e26af74f", "sha256": "c8f4f393152b5d1d0649ee9dc05447b993e909b9951068e46300b4fbc3f606a3" }, "downloads": -1, "filename": "slats-0.0.0.tar.gz", "has_sig": false, "md5_digest": "58eb2de41836edc6f9e14417e26af74f", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 1740, "upload_time": "2019-03-04T05:55:23", "url": "https://files.pythonhosted.org/packages/4a/b9/fb170c4c8a498d33d55729750178a4dafdb8cc91191f27eb341b2142a029/slats-0.0.0.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "21145a109cc92fad604cc4f828847d95", "sha256": "804d71d3d73de1a0e363b09bd2af36fa031ab4fd5cd21b950626aafd7ec707f2" }, "downloads": -1, "filename": "slats-1.0.0.tar.gz", "has_sig": false, "md5_digest": "21145a109cc92fad604cc4f828847d95", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 8325, "upload_time": "2019-05-02T22:12:32", "url": "https://files.pythonhosted.org/packages/5a/c1/a79a5f826ba646d4815f660560a586763c1e7793c702f12038942b1ed242/slats-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "21145a109cc92fad604cc4f828847d95", "sha256": "804d71d3d73de1a0e363b09bd2af36fa031ab4fd5cd21b950626aafd7ec707f2" }, "downloads": -1, "filename": "slats-1.0.0.tar.gz", "has_sig": false, "md5_digest": "21145a109cc92fad604cc4f828847d95", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 8325, "upload_time": "2019-05-02T22:12:32", "url": "https://files.pythonhosted.org/packages/5a/c1/a79a5f826ba646d4815f660560a586763c1e7793c702f12038942b1ed242/slats-1.0.0.tar.gz" } ] }