Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/newca12/tmdb-async-client
Scala async wrapper for TMDb (The Movie Database) API
https://github.com/newca12/tmdb-async-client
api-client api-rest asynchronous movie-database scala tmdb
Last synced: about 3 hours ago
JSON representation
Scala async wrapper for TMDb (The Movie Database) API
- Host: GitHub
- URL: https://github.com/newca12/tmdb-async-client
- Owner: newca12
- License: gpl-3.0
- Created: 2014-01-01T21:37:40.000Z (almost 11 years ago)
- Default Branch: without-X-RateLimit
- Last Pushed: 2023-03-30T12:29:24.000Z (over 1 year ago)
- Last Synced: 2024-02-01T18:21:22.358Z (9 months ago)
- Topics: api-client, api-rest, asynchronous, movie-database, scala, tmdb
- Language: Scala
- Homepage:
- Size: 150 KB
- Stars: 3
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TMDb-async-client
[![Actions Status](https://github.com/newca12/TMDb-async-client/workflows/Scala%20CI/badge.svg?branch=without-X-RateLimit)](https://github.com/newca12/TMDb-async-client/actions)
[![codecov.io](https://img.shields.io/codecov/c/github/newca12/TMDb-async-client.svg)](https://codecov.io/github/newca12/TMDb-async-client?branch=master)
[![Maven Central](https://img.shields.io/maven-central/v/org.edla/tmdb-async-client_2.13.svg)](https://maven-badges.herokuapp.com/maven-central/org.edla/tmdb-async-client_2.13)### About ###
TMDb-async-client is a native Scala SDK that provides asynchronous access to [The Movie Database][1] (TMDb) API.
It is built heavily on [akka-http][2] for async non-blocking HTTP I/O and [spray-json][3] for parsing JSON responses into Scala case classes.
[akka-stream][4] is used to allow limitation of client request frequency and number of parallel requests in respect of TMDb policies.TMDb-async-client is an EDLA project.
The purpose of [edla.org](http://www.edla.org) is to promote the state of the art in various domains.
### API Key ###
You will need an API key to The Movie Database to access the API. To obtain a key, follow these steps:1. Register for and verify an [account](https://www.themoviedb.org/account/signup).
2. [Log](https://www.themoviedb.org/login) into your account
3. Select the API section on left side of your account page.
4. Click on the link to generate a new API key and follow the instructions.### Usage ###
See [Usage.scala](https://github.com/newca12/TMDb-async-client/blob/master/src/main/scala/org/edla/tmdb/client/Usage.scala) for a runnable example.
Each function returns a `Future` of the response from the TMDb API, parsed into a convenient case class.
``` scala
val apiKey = "REPLACE_THIS_WITH_YOUR_OWN_API_KEY"val tmdbClient = TmdbClient(apiKey)
val movie = tmdbClient.getMovie(54181)
val movies = tmdbClient.searchMovie("shark")
tmdbClient.downloadPoster(movie, Paths.get("/tmp/poster.jpg"))
tmdbClient.shutdown
```### Developers ###
API Key need to be available as an environment variable named apiKey if you want to run sbt test
### Related Projects ###
[JavaFX client for TMDb (The Movie Database) ](https://github.com/newca12/TMDb-shelf)
### License ###
© 2014-2021 Olivier ROLAND. Distributed under the GPLv3 License.[1]: http://www.themoviedb.org/
[2]: http://doc.akka.io/docs/akka-http/current/scala/http/index.html
[3]: http://doc.akka.io/docs/akka-http/current/scala/http/common/json-support.html
[4]: http://doc.akka.io/docs/akka/2.4/scala/stream/stream-cookbook.html#Globally_limiting_the_rate_of_a_set_of_streams