{"id":16423892,"url":"https://github.com/oliveroneill/soft","last_synced_at":"2025-10-26T22:31:50.819Z","repository":{"id":63919480,"uuid":"145542448","full_name":"oliveroneill/Soft","owner":"oliveroneill","description":"A Spotify Web API library built for Swift - including Linux support","archived":false,"fork":false,"pushed_at":"2019-04-29T09:36:54.000Z","size":86,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-01T00:51:06.257Z","etag":null,"topics":["linux","macos","server-side-swift","spotify","spotify-web-api","swift","swift-package-manager"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oliveroneill.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-21T09:41:55.000Z","updated_at":"2020-07-16T15:31:09.000Z","dependencies_parsed_at":"2023-01-14T14:00:52.866Z","dependency_job_id":null,"html_url":"https://github.com/oliveroneill/Soft","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliveroneill%2FSoft","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliveroneill%2FSoft/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliveroneill%2FSoft/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliveroneill%2FSoft/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oliveroneill","download_url":"https://codeload.github.com/oliveroneill/Soft/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238408494,"owners_count":19467100,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["linux","macos","server-side-swift","spotify","spotify-web-api","swift","swift-package-manager"],"created_at":"2024-10-11T07:41:14.611Z","updated_at":"2025-10-26T22:31:45.535Z","avatar_url":"https://github.com/oliveroneill.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Soft\n\n[![Build Status](https://travis-ci.org/oliveroneill/Soft.svg?branch=master)](https://travis-ci.org/oliveroneill/Soft)\n[![Platform](https://img.shields.io/badge/Swift-4.2-orange.svg)](https://img.shields.io/badge/Swift-4.2-orange.svg)\n[![Swift Package Manager](https://img.shields.io/badge/spm-compatible-brightgreen.svg?style=flat)](https://swift.org/package-manager)\n![macOS](https://img.shields.io/badge/os-macOS-green.svg?style=flat)\n![Linux](https://img.shields.io/badge/os-linux-green.svg?style=flat)\n\nA Spotify Web API library for Swift. This is to be used with Swift Package\nManager and supports Linux, so that it can run in desktop and server-side\napplications.\n\nThis is based on [rspotify](https://github.com/samrayleung/rspotify)'s\nimplementation.\n\nThis is still a work in progress and supports a limited number of calls.\nSee [SpotifyClient.swift](https://github.com/oliveroneill/Soft/blob/master/Sources/Soft/SpotifyClient.swift)\nfor the supported calls and some TODOs on what to implement next.\nAny help is much appreciated.\n\n## Linux Support\nLinux is now supported in Soft! In future we will remove all the unnecessary\n`CodingKey` declarations, once `keyEncodingStrategy` and `keyDecodingStrategy`\nare supported. See the bug report\n[here](https://bugs.swift.org/browse/SR-7180).\n\n## Installation\nAdd this to your Package.swift:\n\n```swift\n.package(url: \"https://github.com/oliveroneill/Soft.git\", .upToNextMajor(from: \"0.0.6\")),\n```\n\n## Usage\nSee [SpotifyClient.swift](https://github.com/oliveroneill/Soft/blob/master/Sources/Soft/SpotifyClient.swift)\nfor the calls are currently available. There are a number of TODOs in that\nclass for calls that need implementing and I'd appreciate help in\ncompleting the implementation.\n\n### Authorization\nAll methods require user authorization which means you will need to generate\nan authorization token that indicates that the user has granted permission\nfor your application to perform the given task.\n\nYou will need to specify a redirect URL, this URL does not need to lead\nanywhere and is purely used to retrieve query parameters that Spotify\nhas added.\n\n### Example\n```swift\nimport Foundation\nimport Soft\n\ndo {\n    let oauth = try SpotifyOAuth(clientID: \"CLIENT_ID\", clientSecret: \"CLIENT_SECRET\", redirectURI: URL(string: \"http://localhost:8888/callback\")!, state: \"STATE\", scope: \"playlist-read-private\")\n\n    // Dispatch group is used so that program does not exit until the result\n    // is received\n    let dispatchGroup = DispatchGroup()\n    dispatchGroup.enter()\n    getToken(oauth: oauth) { result in\n        switch result {\n        case .success(let token):\n            let client = SpotifyClient(tokenInfo: token)\n            client.track(trackID: \"11dFghVXANMlKmJXsNCbNl\") {\n                print($0)\n                dispatchGroup.leave()\n            }\n        case .failure(let error):\n            print(\"error: \\(error)\")\n            dispatchGroup.leave()\n        }\n    }\n    dispatchGroup.notify(queue: DispatchQueue.main) {\n        exit(EXIT_SUCCESS)\n    }\n    dispatchMain()\n} catch {\n    print(error)\n}\n```\n\n### Running tests on Linux\nUse this command to run tests on Linux while on macOS, using Docker:\n```bash\ndocker run --rm -v \"$(pwd):/pkg\" -w \"/pkg\" swift:latest /bin/bash -c \"swift test --build-path ./.build/linux\"\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foliveroneill%2Fsoft","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foliveroneill%2Fsoft","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foliveroneill%2Fsoft/lists"}