1[![Continuous Integration](https://github.com/ramsayleung/rspotify/workflows/Continuous%20Integration/badge.svg)](https://github.com/ramsayleung/rspotify/actions)
2[![License](https://img.shields.io/github/license/ramsayleung/rspotify)](https://github.com/ramsayleung/rspotify/blob/master/LICENSE)
3[![Crates.io](https://img.shields.io/crates/v/rspotify.svg)](https://crates.io/crates/rspotify)
4[![Docs](https://docs.rs/rspotify/badge.svg)](https://docs.rs/crate/rspotify/)
5
6# Rspotify
7
8Rspotify is a wrapper for the [Spotify Web API](https://developer.spotify.com/documentation/web-api/), inspired by [spotipy](https://github.com/plamere/spotipy). It includes support for all the [authorization flows](https://developer.spotify.com/documentation/general/guides/authorization/), and helper functions for [all endpoints](https://developer.spotify.com/documentation/web-api/reference/).
9
10To learn how to use Rspotify, please refer to the [documentation](https://docs.rs/crate/rspotify/). There are some [examples that may be useful](./examples) as well.
11
12## Changelog
13
14Please see the [changelog](./CHANGELOG.md) for a release history and indications on how to upgrade from one version to another.
15
16## Contributing
17
18If you find any problems or have suggestions about this crate, please submit an issue. Moreover, any pull request, code review and feedback are welcome.
19
20### Code Guide
21
22We use GitHub Actions to make sure the codebase is consistent (`cargo fmt`) and continuously tested (`cargo test`). We try to keep comments at a maximum of 80 characters of length (which isn't automatically checked by `cargo fmt`) and code at 120.
23
24### Trait Hierarchy
25
26![](./doc/images/trait_hierarchy.png)
27
28### Crate Hierarchy
29
30![](./doc/images/crate_hierarchy.png)
31
32## Building
33
34Rspotify uses [`maybe_async`](https://docs.rs/maybe-async/0.2.0/maybe_async/) to switch between async and blocking clients, which is triggered inside `Cargo.toml`. So that must be taken into account when building `rspotify`. Read the Configuration section in the docs for more information about how to build with custom TLS implementations, and more.
35
36`client-reqwest` is used by default. It should be as easy as
37
38```sh
39$ cargo build
40```
41
42`client-ureq` is also available as the `blocking` interface, which compiles Rspotify with [`ureq`](https://docs.rs/ureq/) (a TLS has to be specified as well):
43
44```sh
45$ cargo build --no-default-features --features client-ureq,ureq-rustls-tls
46```
47
48Notice that you can't build `rspotify` with all features like this:
49
50```sh
51$ cargo build --all-features
52```
53
54Because in order to switch between clients, the different clients have to implement the same base trait in [src/http/mod.rs](https://github.com/ramsayleung/rspotify/blob/master/src/http/mod.rs), so if you build with all features, you'll get `duplicate definitions` error. As every coin has two sides, you can only have one side at a time, not all sides of it.
55
56## License
57
58[MIT](./LICENSE)
59