MyNixOS website logo
Description

Get Data Out of 'Tautulli' (Formerly 'PlexPy').

'Tautulli' (<http://tautulli.com>) is a monitoring application for 'Plex' Media Servers (<https://www.plex.tv>) which collects a lot of data about media items and server usage such as play counts. This package interacts with the 'Tautulli' API of any specified server to get said data into R. The 'Tautulli' API documentation is available at <https://github.com/Tautulli/Tautulli/blob/master/API.md>.

tauturri

Travis buildstatus Coveragestatus CRANstatus lifecycle

This is tauturri version 0.3.0 (semver(ish)).
The goal of tauturri is to get data out of Tautulli (formerly PlexPy) as simply as possible.

The project is still pretty young, and while it’s reasonably functional, there might still be some issues. At least it passes all the tests, I guess?

Installation

Current stable version on CRAN:

install.packages("tauturri")

Current development version on GitHub:

if (!("remotes" %in% installed.packages())){
  install.packages("remotes")
}

remotes::install_github("jemus42/tauturri")

Setup

To use this package, you’ll need a working instance of Tautulli, enable the API and store the URL and your API key.

In your ~/.Renviron, set the following:

# Tautulli
tautulli_url=<Tautulli URL (with port, if necessary)>
tautulli_apikey=<Tautilli API key>

That’s it.
Alternatively use Sys.setenv() to set the appropriate values in a script.

Server Info

info <- get_servers_info()

# Probably shouldn't show URL etc.
names(info)
#> [1] "port"               "host"               "version"           
#> [4] "name"               "machine_identifier"
info[c("name", "version")]
#> # A tibble: 1 x 2
#>   name  version              
#>   <chr> <chr>                
#> 1 PPTH  1.13.2.5154-fd05be322

get_plays_by [date|dayofweek|…]

All plays in the current year, per day:

plays <- get_plays_by_date(time_range = lubridate::yday(lubridate::now()))

plays %>% 
  gather(category, playcount, TV, Movies, Music) %>%
  ggplot(aes(x = date, y = playcount, fill = category)) +
  geom_col() +
  scale_fill_brewer(palette = "Set1", 
                    breaks = c("Movies", "TV", "Music")) +
  labs(title = "Plex Plays by Date",
       subtitle = "Showing Movie, TV and Music Categories",
       x = "Date", y = "Plays", fill = "Category") +
  theme_minimal() +
  theme(legend.position = "top")

… per day of week:

plays <- get_plays_by_dayofweek(time_range = lubridate::yday(lubridate::now()))

plays %>% 
  gather(category, playcount, TV, Movies, Music) %>%
  ggplot(aes(x = day, y = playcount, fill = category)) +
  geom_col() +
  scale_fill_brewer(palette = "Set1", 
                    breaks = c("Movies", "TV", "Music")) +
  labs(title = "Plex Plays by Day of Week",
       subtitle = "Showing Movie, TV and Music Categories",
       x = "Day", y = "Plays", fill = "Category") +
  theme_minimal() +
  theme(legend.position = "top")

… and per hour of day:

plays <- get_plays_by_hourofday(time_range = lubridate::yday(lubridate::now()))

plays %>% 
  gather(category, playcount, TV, Movies, Music) %>%
  ggplot(aes(x = hms::hms(hours = hour), y = playcount, fill = category)) +
  geom_col() +
  scale_fill_brewer(palette = "Set1", 
                    breaks = c("Movies", "TV", "Music")) +
  labs(title = "Plex Plays by Hour of Day",
       subtitle = "Showing Movie, TV and Music Categories",
       x = "Hour", y = "Plays", fill = "Category") +
  theme_minimal() +
  theme(legend.position = "top")

API Functions Not Yet Implemented

api_functions <- names(api_request(cmd = "docs")$data)
api_functions <- api_functions[grepl("^get_", api_functions)]
sort(api_functions[!(api_functions %in% getNamespaceExports("tauturri"))])
#>  [1] "get_apikey"              "get_date_formats"       
#>  [3] "get_geoip_lookup"        "get_logs"               
#>  [5] "get_metadata"            "get_new_rating_keys"    
#>  [7] "get_newsletter_config"   "get_newsletter_log"     
#>  [9] "get_newsletters"         "get_notification_log"   
#> [11] "get_notifier_config"     "get_notifier_parameters"
#> [13] "get_notifiers"           "get_old_rating_keys"    
#> [15] "get_plex_log"            "get_pms_token"          
#> [17] "get_server_pref"         "get_settings"           
#> [19] "get_stream_data"         "get_synced_items"       
#> [21] "get_user"                "get_whois_lookup"

CoC

Please note that this project is released with a Contributor Code of Conduct.
By participating in this project you agree to abide by its terms.

Metadata

Version

0.3.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows