plex-api-client


Nameplex-api-client JSON
Version 0.31.1 PyPI version JSON
download
home_pagehttps://github.com/LukeHagar/plexpy.git
SummaryPython Client SDK Generated by Speakeasy
upload_time2025-10-13 00:04:33
maintainerNone
docs_urlNone
authorSpeakeasy
requires_python>=3.9.2
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # plexpy

<div align="left">
    <a href="https://speakeasyapi.dev/"><img src="https://custom-icon-badges.demolab.com/badge/-Built%20By%20Speakeasy-212015?style=for-the-badge&logoColor=FBE331&logo=speakeasy&labelColor=545454" /></a>
    <a href="https://opensource.org/licenses/MIT">
        <img src="https://img.shields.io/badge/License-MIT-blue.svg" style="width: 100px; height: 28px;" />
    </a>
</div>

<!-- Start Summary [summary] -->
## Summary


<!-- End Summary [summary] -->

<!-- Start Table of Contents [toc] -->
## Table of Contents
<!-- $toc-max-depth=2 -->
* [plexpy](https://github.com/LukeHagar/plexpy/blob/master/./#plexpy)
  * [SDK Installation](https://github.com/LukeHagar/plexpy/blob/master/./#sdk-installation)
  * [IDE Support](https://github.com/LukeHagar/plexpy/blob/master/./#ide-support)
  * [SDK Example Usage](https://github.com/LukeHagar/plexpy/blob/master/./#sdk-example-usage)
  * [Available Resources and Operations](https://github.com/LukeHagar/plexpy/blob/master/./#available-resources-and-operations)
  * [File uploads](https://github.com/LukeHagar/plexpy/blob/master/./#file-uploads)
  * [Retries](https://github.com/LukeHagar/plexpy/blob/master/./#retries)
  * [Error Handling](https://github.com/LukeHagar/plexpy/blob/master/./#error-handling)
  * [Server Selection](https://github.com/LukeHagar/plexpy/blob/master/./#server-selection)
  * [Custom HTTP Client](https://github.com/LukeHagar/plexpy/blob/master/./#custom-http-client)
  * [Authentication](https://github.com/LukeHagar/plexpy/blob/master/./#authentication)
  * [Resource Management](https://github.com/LukeHagar/plexpy/blob/master/./#resource-management)
  * [Debugging](https://github.com/LukeHagar/plexpy/blob/master/./#debugging)
* [Development](https://github.com/LukeHagar/plexpy/blob/master/./#development)
  * [Maturity](https://github.com/LukeHagar/plexpy/blob/master/./#maturity)
  * [Contributions](https://github.com/LukeHagar/plexpy/blob/master/./#contributions)

<!-- End Table of Contents [toc] -->

<!-- Start SDK Installation [installation] -->
## SDK Installation

> [!NOTE]
> **Python version upgrade policy**
>
> Once a Python version reaches its [official end of life date](https://devguide.python.org/versions/), a 3-month grace period is provided for users to upgrade. Following this grace period, the minimum python version supported in the SDK will be updated.

The SDK can be installed with *uv*, *pip*, or *poetry* package managers.

### uv

*uv* is a fast Python package installer and resolver, designed as a drop-in replacement for pip and pip-tools. It's recommended for its speed and modern Python tooling capabilities.

```bash
uv add plex-api-client
```

### PIP

*PIP* is the default package installer for Python, enabling easy installation and management of packages from PyPI via the command line.

```bash
pip install plex-api-client
```

### Poetry

*Poetry* is a modern tool that simplifies dependency management and package publishing by using a single `pyproject.toml` file to handle project metadata and dependencies.

```bash
poetry add plex-api-client
```

### Shell and script usage with `uv`

You can use this SDK in a Python shell with [uv](https://docs.astral.sh/uv/) and the `uvx` command that comes with it like so:

```shell
uvx --from plex-api-client python
```

It's also possible to write a standalone Python script without needing to set up a whole project like so:

```python
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.9"
# dependencies = [
#     "plex-api-client",
# ]
# ///

from plex_api_client import PlexAPI

sdk = PlexAPI(
  # SDK arguments
)

# Rest of script here...
```

Once that is saved to a file, you can run it with `uv run script.py` where
`script.py` can be replaced with the actual file name.
<!-- End SDK Installation [installation] -->

<!-- Start IDE Support [idesupport] -->
## IDE Support

### PyCharm

Generally, the SDK will work well with most IDEs out of the box. However, when using PyCharm, you can enjoy much better integration with Pydantic by installing an additional plugin.

- [PyCharm Pydantic Plugin](https://docs.pydantic.dev/latest/integrations/pycharm/)
<!-- End IDE Support [idesupport] -->

<!-- Start SDK Example Usage [usage] -->
## SDK Example Usage

### Example

```python
# Synchronous Example
from plex_api_client import PlexAPI
from plex_api_client.models import components, operations


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.transcoder.start_transcode_session(request=operations.StartTranscodeSessionRequest(
        transcode_type=components.TranscodeType.MUSIC,
        extension=operations.Extension.MPD,
        advanced_subtitles=components.AdvancedSubtitles.BURN,
        audio_boost=50,
        audio_channel_count=5,
        auto_adjust_quality=components.BoolInt.ONE,
        auto_adjust_subtitle=components.BoolInt.ONE,
        direct_play=components.BoolInt.ONE,
        direct_stream=components.BoolInt.ONE,
        direct_stream_audio=components.BoolInt.ONE,
        disable_resolution_rotation=components.BoolInt.ONE,
        has_mde=components.BoolInt.ONE,
        location=operations.StartTranscodeSessionQueryParamLocation.WAN,
        media_buffer_size=102400,
        media_index=0,
        music_bitrate=5000,
        offset=90.5,
        part_index=0,
        path="/library/metadata/151671",
        peak_bitrate=12000,
        photo_resolution="1080x1080",
        protocol=operations.StartTranscodeSessionQueryParamProtocol.DASH,
        seconds_per_segment=5,
        subtitle_size=50,
        video_bitrate=12000,
        video_quality=50,
        video_resolution="1080x1080",
        x_plex_client_profile_extra="add-limitation(scope=videoCodec&scopeName=*&type=upperBound&name=video.frameRate&value=60&replace=true)+append-transcode-target-codec(type=videoProfile&context=streaming&videoCodec=h264%2Chevc&audioCodec=aac&protocol=dash)",
        x_plex_client_profile_name="generic",
    ))

    assert res.response_stream is not None

    # Handle response
    print(res.response_stream)
```

</br>

The same SDK client can also be used to make asynchronous requests by importing asyncio.

```python
# Asynchronous Example
import asyncio
from plex_api_client import PlexAPI
from plex_api_client.models import components, operations

async def main():

    async with PlexAPI(
        accepts=components.Accepts.APPLICATION_XML,
        client_identifier="abc123",
        product="Plex for Roku",
        version="2.4.1",
        platform="Roku",
        platform_version="4.3 build 1057",
        device="Roku 3",
        model="4200X",
        device_vendor="Roku",
        device_name="Living Room TV",
        marketplace="googlePlay",
        token="<YOUR_API_KEY_HERE>",
    ) as plex_api:

        res = await plex_api.transcoder.start_transcode_session_async(request=operations.StartTranscodeSessionRequest(
            transcode_type=components.TranscodeType.MUSIC,
            extension=operations.Extension.MPD,
            advanced_subtitles=components.AdvancedSubtitles.BURN,
            audio_boost=50,
            audio_channel_count=5,
            auto_adjust_quality=components.BoolInt.ONE,
            auto_adjust_subtitle=components.BoolInt.ONE,
            direct_play=components.BoolInt.ONE,
            direct_stream=components.BoolInt.ONE,
            direct_stream_audio=components.BoolInt.ONE,
            disable_resolution_rotation=components.BoolInt.ONE,
            has_mde=components.BoolInt.ONE,
            location=operations.StartTranscodeSessionQueryParamLocation.WAN,
            media_buffer_size=102400,
            media_index=0,
            music_bitrate=5000,
            offset=90.5,
            part_index=0,
            path="/library/metadata/151671",
            peak_bitrate=12000,
            photo_resolution="1080x1080",
            protocol=operations.StartTranscodeSessionQueryParamProtocol.DASH,
            seconds_per_segment=5,
            subtitle_size=50,
            video_bitrate=12000,
            video_quality=50,
            video_resolution="1080x1080",
            x_plex_client_profile_extra="add-limitation(scope=videoCodec&scopeName=*&type=upperBound&name=video.frameRate&value=60&replace=true)+append-transcode-target-codec(type=videoProfile&context=streaming&videoCodec=h264%2Chevc&audioCodec=aac&protocol=dash)",
            x_plex_client_profile_name="generic",
        ))

        assert res.response_stream is not None

        # Handle response
        print(res.response_stream)

asyncio.run(main())
```
<!-- End SDK Example Usage [usage] -->

<!-- Start Available Resources and Operations [operations] -->
## Available Resources and Operations

<details open>
<summary>Available methods</summary>

### [activities](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/activities/README.md)

* [list_activities](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/activities/README.md#list_activities) - Get all activities
* [cancel_activity](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/activities/README.md#cancel_activity) - Cancel a running activity

### [butler](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/butler/README.md)

* [stop_tasks](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/butler/README.md#stop_tasks) - Stop all Butler tasks
* [get_tasks](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/butler/README.md#get_tasks) - Get all Butler tasks
* [start_tasks](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/butler/README.md#start_tasks) - Start all Butler tasks
* [stop_task](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/butler/README.md#stop_task) - Stop a single Butler task
* [start_task](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/butler/README.md#start_task) - Start a single Butler task

### [collections](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/collections/README.md)

* [create_collection](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/collections/README.md#create_collection) - Create collection

### [content](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/content/README.md)

* [get_collection_items](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/content/README.md#get_collection_items) - Get items in a collection
* [get_metadata_item](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/content/README.md#get_metadata_item) - Get a metadata item
* [get_albums](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/content/README.md#get_albums) - Set section albums
* [list_content](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/content/README.md#list_content) - Get items in the section
* [get_all_leaves](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/content/README.md#get_all_leaves) - Set section leaves
* [get_arts](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/content/README.md#get_arts) - Set section artwork
* [get_categories](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/content/README.md#get_categories) - Set section categories
* [get_cluster](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/content/README.md#get_cluster) - Set section clusters
* [get_sonic_path](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/content/README.md#get_sonic_path) - Similar tracks to transition from one to another
* [get_folders](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/content/README.md#get_folders) - Get all folder locations
* [list_moments](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/content/README.md#list_moments) - Set section moments
* [get_sonically_similar](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/content/README.md#get_sonically_similar) - The nearest audio tracks
* [get_collection_image](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/content/README.md#get_collection_image) - Get a collection's image

### [devices](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/devices/README.md)

* [get_available_grabbers](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/devices/README.md#get_available_grabbers) - Get available grabbers
* [list_devices](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/devices/README.md#list_devices) - Get all devices
* [add_device](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/devices/README.md#add_device) - Add a device
* [discover_devices](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/devices/README.md#discover_devices) - Tell grabbers to discover devices
* [remove_device](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/devices/README.md#remove_device) - Remove a device
* [get_device_details](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/devices/README.md#get_device_details) - Get device details
* [modify_device](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/devices/README.md#modify_device) - Enable or disable a device
* [set_channelmap](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/devices/README.md#set_channelmap) - Set a device's channel mapping
* [get_devices_channels](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/devices/README.md#get_devices_channels) - Get a device's channels
* [set_device_preferences](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/devices/README.md#set_device_preferences) - Set device preferences
* [stop_scan](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/devices/README.md#stop_scan) - Tell a device to stop scanning for channels
* [scan](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/devices/README.md#scan) - Tell a device to scan for channels
* [get_thumb](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/devices/README.md#get_thumb) - Get device thumb

### [download_queue](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/downloadqueue/README.md)

* [create_download_queue](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/downloadqueue/README.md#create_download_queue) - Create download queue
* [get_download_queue](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/downloadqueue/README.md#get_download_queue) - Get a download queue
* [add_download_queue_items](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/downloadqueue/README.md#add_download_queue_items) - Add to download queue
* [list_download_queue_items](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/downloadqueue/README.md#list_download_queue_items) - Get download queue items
* [get_item_decision](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/downloadqueue/README.md#get_item_decision) - Grab download queue item decision
* [get_download_queue_media](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/downloadqueue/README.md#get_download_queue_media) - Grab download queue media
* [remove_download_queue_items](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/downloadqueue/README.md#remove_download_queue_items) - Delete download queue items
* [get_download_queue_items](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/downloadqueue/README.md#get_download_queue_items) - Get download queue items
* [restart_processing_download_queue_items](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/downloadqueue/README.md#restart_processing_download_queue_items) - Restart processing of items from the decision

### [dv_rs](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/dvrs/README.md)

* [list_dv_rs](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/dvrs/README.md#list_dv_rs) - Get DVRs
* [create_dvr](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/dvrs/README.md#create_dvr) - Create a DVR
* [delete_dvr](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/dvrs/README.md#delete_dvr) - Delete a single DVR
* [get_dvr](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/dvrs/README.md#get_dvr) - Get a single DVR
* [delete_lineup](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/dvrs/README.md#delete_lineup) - Delete a DVR Lineup
* [add_lineup](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/dvrs/README.md#add_lineup) - Add a DVR Lineup
* [set_dvr_preferences](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/dvrs/README.md#set_dvr_preferences) - Set DVR preferences
* [stop_dvr_reload](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/dvrs/README.md#stop_dvr_reload) - Tell a DVR to stop reloading program guide
* [reload_guide](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/dvrs/README.md#reload_guide) - Tell a DVR to reload program guide
* [tune_channel](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/dvrs/README.md#tune_channel) - Tune a channel on a DVR
* [remove_device_from_dvr](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/dvrs/README.md#remove_device_from_dvr) - Remove a device from an existing DVR
* [add_device_to_dvr](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/dvrs/README.md#add_device_to_dvr) - Add a device to an existing DVR

### [epg](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/epg/README.md)

* [compute_channel_map](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/epg/README.md#compute_channel_map) - Compute the best channel map
* [get_channels](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/epg/README.md#get_channels) - Get channels for a lineup
* [get_countries](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/epg/README.md#get_countries) - Get all countries
* [get_all_languages](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/epg/README.md#get_all_languages) - Get all languages
* [get_lineup](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/epg/README.md#get_lineup) - Compute the best lineup
* [get_lineup_channels](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/epg/README.md#get_lineup_channels) - Get the channels for mulitple lineups
* [get_countries_lineups](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/epg/README.md#get_countries_lineups) - Get lineups for a country via postal code
* [get_country_regions](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/epg/README.md#get_country_regions) - Get regions for a country
* [list_lineups](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/epg/README.md#list_lineups) - Get lineups for a region

### [events](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/events/README.md)

* [get_notifications](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/events/README.md#get_notifications) - Connect to Eventsource
* [connect_web_socket](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/events/README.md#connect_web_socket) - Connect to WebSocket

### [general](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/general/README.md)

* [get_server_info](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/general/README.md#get_server_info) - Get PMS info
* [get_identity](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/general/README.md#get_identity) - Get PMS identity
* [get_source_connection_information](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/general/README.md#get_source_connection_information) - Get Source Connection Information
* [get_transient_token](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/general/README.md#get_transient_token) - Get Transient Tokens

### [hubs](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/hubs/README.md)

* [get_all_hubs](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/hubs/README.md#get_all_hubs) - Get global hubs
* [get_continue_watching](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/hubs/README.md#get_continue_watching) - Get the continue watching hub
* [get_hub_items](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/hubs/README.md#get_hub_items) - Get a hub's items
* [get_promoted_hubs](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/hubs/README.md#get_promoted_hubs) - Get the hubs which are promoted
* [get_metadata_hubs](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/hubs/README.md#get_metadata_hubs) - Get hubs for section by metadata item
* [get_postplay_hubs](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/hubs/README.md#get_postplay_hubs) - Get postplay hubs
* [get_related_hubs](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/hubs/README.md#get_related_hubs) - Get related hubs
* [get_section_hubs](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/hubs/README.md#get_section_hubs) - Get section hubs
* [reset_section_defaults](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/hubs/README.md#reset_section_defaults) - Reset hubs to defaults
* [list_hubs](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/hubs/README.md#list_hubs) - Get hubs
* [create_custom_hub](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/hubs/README.md#create_custom_hub) - Create a custom hub
* [move_hub](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/hubs/README.md#move_hub) - Move Hub
* [delete_custom_hub](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/hubs/README.md#delete_custom_hub) - Delete a custom hub
* [update_hub_visibility](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/hubs/README.md#update_hub_visibility) - Change hub visibility

### [library](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md)

* [get_library_items](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_library_items) - Get all items in library
* [delete_caches](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#delete_caches) - Delete library caches
* [clean_bundles](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#clean_bundles) - Clean bundles
* [ingest_transient_item](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#ingest_transient_item) - Ingest a transient item
* [get_library_matches](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_library_matches) - Get library matches
* [optimize_database](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#optimize_database) - Optimize the Database
* [get_random_artwork](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_random_artwork) - Get random artwork
* [get_sections](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_sections) - Get library sections (main Media Provider Only)
* [add_section](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#add_section) - Add a library section
* [stop_all_refreshes](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#stop_all_refreshes) - Stop refresh
* [get_sections_prefs](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_sections_prefs) - Get section prefs
* [refresh_sections_metadata](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#refresh_sections_metadata) - Refresh all sections
* [get_tags](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_tags) - Get all library tags of a type
* [delete_metadata_item](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#delete_metadata_item) - Delete a metadata item
* [edit_metadata_item](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#edit_metadata_item) - Edit a metadata item
* [detect_ads](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#detect_ads) - Ad-detect an item
* [get_all_item_leaves](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_all_item_leaves) - Get the leaves of an item
* [analyze_metadata](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#analyze_metadata) - Analyze an item
* [generate_thumbs](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#generate_thumbs) - Generate thumbs of chapters for an item
* [detect_credits](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#detect_credits) - Credit detect a metadata item
* [get_extras](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_extras) - Get an item's extras
* [add_extras](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#add_extras) - Add to an item's extras
* [get_file](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_file) - Get a file from a metadata or media bundle
* [start_bif_generation](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#start_bif_generation) - Start BIF generation of an item
* [detect_intros](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#detect_intros) - Intro detect an item
* [create_marker](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#create_marker) - Create a marker
* [match_item](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#match_item) - Match a metadata item
* [list_matches](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#list_matches) - Get metadata matches for an item
* [merge_items](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#merge_items) - Merge a metadata item
* [list_sonically_similar](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#list_sonically_similar) - Get nearest tracks to metadata item
* [set_item_preferences](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#set_item_preferences) - Set metadata preferences
* [refresh_items_metadata](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#refresh_items_metadata) - Refresh a metadata item
* [get_related_items](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_related_items) - Get related items
* [list_similar](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#list_similar) - Get similar items
* [split_item](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#split_item) - Split a metadata item
* [add_subtitles](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#add_subtitles) - Add subtitles
* [get_item_tree](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_item_tree) - Get metadata items as a tree
* [unmatch](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#unmatch) - Unmatch a metadata item
* [list_top_users](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#list_top_users) - Get metadata top users
* [detect_voice_activity](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#detect_voice_activity) - Detect voice activity
* [get_augmentation_status](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_augmentation_status) - Get augmentation status
* [set_stream_selection](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#set_stream_selection) - Set stream selection
* [get_person](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_person) - Get person details
* [list_person_media](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#list_person_media) - Get media for a person
* [delete_library_section](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#delete_library_section) - Delete a library section
* [get_library_details](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_library_details) - Get a library section by id
* [edit_section](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#edit_section) - Edit a library section
* [update_items](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#update_items) - Set the fields of the filtered items
* [start_analysis](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#start_analysis) - Analyze a section
* [autocomplete](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#autocomplete) - Get autocompletions for search
* [get_collections](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_collections) - Get collections in a section
* [get_common](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_common) - Get common fields for items
* [empty_trash](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#empty_trash) - Empty section trash
* [get_section_filters](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_section_filters) - Get section filters
* [get_first_characters](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_first_characters) - Get list of first characters
* [delete_indexes](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#delete_indexes) - Delete section indexes
* [delete_intros](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#delete_intros) - Delete section intro markers
* [get_section_preferences](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_section_preferences) - Get section prefs
* [set_section_preferences](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#set_section_preferences) - Set section prefs
* [cancel_refresh](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#cancel_refresh) - Cancel section refresh
* [refresh_section](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#refresh_section) - Refresh section
* [get_available_sorts](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_available_sorts) - Get a section sorts
* [get_stream_levels](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_stream_levels) - Get loudness about a stream in json
* [get_stream_loudness](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_stream_loudness) - Get loudness about a stream
* [get_chapter_image](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_chapter_image) - Get a chapter image
* [set_item_artwork](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#set_item_artwork) - Set an item's artwork, theme, etc
* [update_item_artwork](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#update_item_artwork) - Set an item's artwork, theme, etc
* [delete_marker](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#delete_marker) - Delete a marker
* [edit_marker](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#edit_marker) - Edit a marker
* [delete_media_item](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#delete_media_item) - Delete a media item
* [get_part_index](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_part_index) - Get BIF index for a part
* [delete_collection](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#delete_collection) - Delete a collection
* [get_section_image](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_section_image) - Get a section composite image
* [delete_stream](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#delete_stream) - Delete a stream
* [get_stream](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_stream) - Get a stream
* [set_stream_offset](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#set_stream_offset) - Set a stream offset
* [get_item_artwork](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_item_artwork) - Get an item's artwork, theme, etc
* [get_media_part](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_media_part) - Get a media part
* [get_image_from_bif](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_image_from_bif) - Get an image from part BIF

### [library_collections](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/librarycollections/README.md)

* [add_collection_items](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/librarycollections/README.md#add_collection_items) - Add items to a collection
* [delete_collection_item](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/librarycollections/README.md#delete_collection_item) - Delete an item from a collection
* [move_collection_item](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/librarycollections/README.md#move_collection_item) - Reorder an item in the collection

### [library_playlists](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/libraryplaylists/README.md)

* [create_playlist](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/libraryplaylists/README.md#create_playlist) - Create a Playlist
* [upload_playlist](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/libraryplaylists/README.md#upload_playlist) - Upload
* [delete_playlist](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/libraryplaylists/README.md#delete_playlist) - Delete a Playlist
* [update_playlist](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/libraryplaylists/README.md#update_playlist) - Editing a Playlist
* [get_playlist_generators](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/libraryplaylists/README.md#get_playlist_generators) - Get a playlist's generators
* [clear_playlist_items](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/libraryplaylists/README.md#clear_playlist_items) - Clearing a playlist
* [add_playlist_items](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/libraryplaylists/README.md#add_playlist_items) - Adding to  a Playlist
* [delete_playlist_item](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/libraryplaylists/README.md#delete_playlist_item) - Delete a Generator
* [get_playlist_generator](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/libraryplaylists/README.md#get_playlist_generator) - Get a playlist generator
* [modify_playlist_generator](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/libraryplaylists/README.md#modify_playlist_generator) - Modify a Generator
* [get_playlist_generator_items](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/libraryplaylists/README.md#get_playlist_generator_items) - Get a playlist generator's items
* [move_playlist_item](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/libraryplaylists/README.md#move_playlist_item) - Moving items in a playlist
* [refresh_playlist](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/libraryplaylists/README.md#refresh_playlist) - Reprocess a generator

### [live_tv](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/livetv/README.md)

* [get_sessions](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/livetv/README.md#get_sessions) - Get all sessions
* [get_live_tv_session](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/livetv/README.md#get_live_tv_session) - Get a single session
* [get_session_playlist_index](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/livetv/README.md#get_session_playlist_index) - Get a session playlist index
* [get_session_segment](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/livetv/README.md#get_session_segment) - Get a single session segment

### [log](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/log/README.md)

* [write_log](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/log/README.md#write_log) - Logging a multi-line message to the Plex Media Server log
* [write_message](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/log/README.md#write_message) - Logging a single-line message to the Plex Media Server log
* [enable_papertrail](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/log/README.md#enable_papertrail) - Enabling Papertrail

### [play_queue](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/playqueue/README.md)

* [create_play_queue](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/playqueue/README.md#create_play_queue) - Create a play queue
* [get_play_queue](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/playqueue/README.md#get_play_queue) - Retrieve a play queue
* [add_to_play_queue](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/playqueue/README.md#add_to_play_queue) - Add a generator or playlist to a play queue
* [clear_play_queue](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/playqueue/README.md#clear_play_queue) - Clear a play queue
* [reset_play_queue](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/playqueue/README.md#reset_play_queue) - Reset a play queue
* [shuffle](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/playqueue/README.md#shuffle) - Shuffle a play queue
* [unshuffle](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/playqueue/README.md#unshuffle) - Unshuffle a play queue
* [delete_play_queue_item](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/playqueue/README.md#delete_play_queue_item) - Delete an item from a play queue
* [move_play_queue_item](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/playqueue/README.md#move_play_queue_item) - Move an item in a play queue

### [playlist](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/playlist/README.md)

* [list_playlists](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/playlist/README.md#list_playlists) - List playlists
* [get_playlist](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/playlist/README.md#get_playlist) - Retrieve Playlist
* [get_playlist_items](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/playlist/README.md#get_playlist_items) - Retrieve Playlist Contents

### [preferences](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/preferences/README.md)

* [get_all_preferences](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/preferences/README.md#get_all_preferences) - Get all preferences
* [set_preferences](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/preferences/README.md#set_preferences) - Set preferences
* [get_preference](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/preferences/README.md#get_preference) - Get a preferences

### [provider](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/provider/README.md)

* [list_providers](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/provider/README.md#list_providers) - Get the list of available media providers
* [add_provider](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/provider/README.md#add_provider) - Add a media provider
* [refresh_providers](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/provider/README.md#refresh_providers) - Refresh media providers
* [delete_media_provider](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/provider/README.md#delete_media_provider) - Delete a media provider

### [rate](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/rate/README.md)

* [set_rating](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/rate/README.md#set_rating) - Rate an item

### [search](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/search/README.md)

* [search_hubs](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/search/README.md#search_hubs) - Search Hub
* [voice_search_hubs](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/search/README.md#voice_search_hubs) - Voice Search Hub

### [status](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/status/README.md)

* [list_sessions](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/status/README.md#list_sessions) - List Sessions
* [get_background_tasks](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/status/README.md#get_background_tasks) - Get background tasks
* [list_playback_history](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/status/README.md#list_playback_history) - List Playback History
* [terminate_session](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/status/README.md#terminate_session) - Terminate a session
* [delete_history](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/status/README.md#delete_history) - Delete Single History Item
* [get_history_item](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/status/README.md#get_history_item) - Get Single History Item

### [subscriptions](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/subscriptions/README.md)

* [get_all_subscriptions](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/subscriptions/README.md#get_all_subscriptions) - Get all subscriptions
* [create_subscription](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/subscriptions/README.md#create_subscription) - Create a subscription
* [process_subscriptions](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/subscriptions/README.md#process_subscriptions) - Process all subscriptions
* [get_scheduled_recordings](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/subscriptions/README.md#get_scheduled_recordings) - Get all scheduled recordings
* [get_template](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/subscriptions/README.md#get_template) - Get the subscription template
* [cancel_grab](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/subscriptions/README.md#cancel_grab) - Cancel an existing grab
* [delete_subscription](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/subscriptions/README.md#delete_subscription) - Delete a subscription
* [get_subscription](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/subscriptions/README.md#get_subscription) - Get a single subscription
* [edit_subscription_preferences](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/subscriptions/README.md#edit_subscription_preferences) - Edit a subscription
* [reorder_subscription](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/subscriptions/README.md#reorder_subscription) - Re-order a subscription

### [timeline](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/timeline/README.md)

* [mark_played](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/timeline/README.md#mark_played) - Mark an item as played
* [report](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/timeline/README.md#report) - Report media timeline
* [unscrobble](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/timeline/README.md#unscrobble) - Mark an item as unplayed

### [transcoder](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/transcoder/README.md)

* [transcode_image](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/transcoder/README.md#transcode_image) - Transcode an image
* [make_decision](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/transcoder/README.md#make_decision) - Make a decision on media playback
* [trigger_fallback](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/transcoder/README.md#trigger_fallback) - Manually trigger a transcoder fallback
* [transcode_subtitles](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/transcoder/README.md#transcode_subtitles) - Transcode subtitles
* [start_transcode_session](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/transcoder/README.md#start_transcode_session) - Start A Transcoding Session

### [ultra_blur](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/ultrablur/README.md)

* [get_colors](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/ultrablur/README.md#get_colors) - Get UltraBlur Colors
* [get_image](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/ultrablur/README.md#get_image) - Get UltraBlur Image

### [updater](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/updater/README.md)

* [apply_updates](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/updater/README.md#apply_updates) - Applying updates
* [check_updates](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/updater/README.md#check_updates) - Checking for updates
* [get_updates_status](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/updater/README.md#get_updates_status) - Querying status of updates

</details>
<!-- End Available Resources and Operations [operations] -->

<!-- Start File uploads [file-upload] -->
## File uploads

Certain SDK methods accept file objects as part of a request body or multi-part request. It is possible and typically recommended to upload files as a stream rather than reading the entire contents into memory. This avoids excessive memory consumption and potentially crashing with out-of-memory errors when working with very large files. The following example demonstrates how to attach a file stream to a request.

> [!TIP]
>
> For endpoints that handle file uploads bytes arrays can also be used. However, using streams is recommended for large files.
>

```python
from plex_api_client import PlexAPI


with PlexAPI(
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.log.write_log(request=open("example.file", "rb"))

    assert res is not None

    # Handle response
    print(res)

```
<!-- End File uploads [file-upload] -->

<!-- Start Retries [retries] -->
## Retries

Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.

To change the default retry strategy for a single API call, simply provide a `RetryConfig` object to the call:
```python
from plex_api_client import PlexAPI
from plex_api_client.models import components
from plex_api_client.utils import BackoffStrategy, RetryConfig


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.general.get_server_info(request={},
        RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False))

    assert res.media_container_with_directory is not None

    # Handle response
    print(res.media_container_with_directory)

```

If you'd like to override the default retry strategy for all operations that support retries, you can use the `retry_config` optional parameter when initializing the SDK:
```python
from plex_api_client import PlexAPI
from plex_api_client.models import components
from plex_api_client.utils import BackoffStrategy, RetryConfig


with PlexAPI(
    retry_config=RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False),
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.general.get_server_info(request={})

    assert res.media_container_with_directory is not None

    # Handle response
    print(res.media_container_with_directory)

```
<!-- End Retries [retries] -->

<!-- Start Error Handling [errors] -->
## Error Handling

[`PlexAPIError`](https://github.com/LukeHagar/plexpy/blob/master/././src/plex_api_client/models/errors/plexapierror.py) is the base class for all HTTP error responses. It has the following properties:

| Property           | Type             | Description                                            |
| ------------------ | ---------------- | ------------------------------------------------------ |
| `err.message`      | `str`            | Error message                                          |
| `err.status_code`  | `int`            | HTTP response status code eg `404`                     |
| `err.headers`      | `httpx.Headers`  | HTTP response headers                                  |
| `err.body`         | `str`            | HTTP body. Can be empty string if no body is returned. |
| `err.raw_response` | `httpx.Response` | Raw HTTP response                                      |

### Example
```python
from plex_api_client import PlexAPI
from plex_api_client.models import components, errors


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:
    res = None
    try:

        res = plex_api.general.get_server_info(request={})

        assert res.media_container_with_directory is not None

        # Handle response
        print(res.media_container_with_directory)


    except errors.PlexAPIError as e:
        # The base class for HTTP error responses
        print(e.message)
        print(e.status_code)
        print(e.body)
        print(e.headers)
        print(e.raw_response)

```

### Error Classes
**Primary error:**
* [`PlexAPIError`](https://github.com/LukeHagar/plexpy/blob/master/././src/plex_api_client/models/errors/plexapierror.py): The base class for HTTP error responses.

<details><summary>Less common errors (5)</summary>

<br />

**Network errors:**
* [`httpx.RequestError`](https://www.python-httpx.org/exceptions/#httpx.RequestError): Base class for request errors.
    * [`httpx.ConnectError`](https://www.python-httpx.org/exceptions/#httpx.ConnectError): HTTP client was unable to make a request to a server.
    * [`httpx.TimeoutException`](https://www.python-httpx.org/exceptions/#httpx.TimeoutException): HTTP request timed out.


**Inherit from [`PlexAPIError`](https://github.com/LukeHagar/plexpy/blob/master/././src/plex_api_client/models/errors/plexapierror.py)**:
* [`ResponseValidationError`](https://github.com/LukeHagar/plexpy/blob/master/././src/plex_api_client/models/errors/responsevalidationerror.py): Type mismatch between the response data and the expected Pydantic model. Provides access to the Pydantic validation error via the `cause` attribute.

</details>
<!-- End Error Handling [errors] -->

<!-- Start Server Selection [server] -->
## Server Selection

### Select Server by Index

You can override the default server globally by passing a server index to the `server_idx: int` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:

| #   | Server                                                     | Variables                                    | Description |
| --- | ---------------------------------------------------------- | -------------------------------------------- | ----------- |
| 0   | `https://{IP-description}.{identifier}.plex.direct:{port}` | `identifier`<br/>`IP-description`<br/>`port` |             |
| 1   | `{protocol}://{host}:{port}`                               | `protocol`<br/>`host`<br/>`port`             |             |
| 2   | `https://{full_server_url}`                                | `server_url`                                 |             |

If the selected server has variables, you may override its default values through the additional parameters made available in the SDK constructor:

| Variable         | Parameter                | Default                              | Description                                                                                                                                                                                                                                                                                                                                                                          |
| ---------------- | ------------------------ | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `identifier`     | `identifier: str`        | `"0123456789abcdef0123456789abcdef"` | The unique identifier of this particular PMS                                                                                                                                                                                                                                                                                                                                         |
| `IP-description` | `ip_description: str`    | `"1-2-3-4"`                          | A `-` separated string of the IPv4 or IPv6 address components                                                                                                                                                                                                                                                                                                                        |
| `port`           | `port: str`              | `"32400"`                            | The Port number configured on the PMS. Typically (`32400`). <br/>If using a reverse proxy, this would be the port number configured on the proxy.<br/>                                                                                                                                                                                                                               |
| `protocol`       | `protocol: str`          | `"http"`                             | The network protocol to use. Typically (`http` or `https`)                                                                                                                                                                                                                                                                                                                           |
| `host`           | `host: str`              | `"localhost"`                        | The Host of the PMS.<br/>If using on a local network, this is the internal IP address of the server hosting the PMS.<br/>If using on an external network, this is the external IP address for your network, and requires port forwarding.<br/>If using a reverse proxy, this would be the external DNS domain for your network, and requires the proxy handle port forwarding. <br/> |
| `server_url`     | `server_url_global: str` | `"http://localhost:32400"`           | The full manual URL to access the PMS                                                                                                                                                                                                                                                                                                                                                |

#### Example

```python
from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    server_idx=1,
    protocol="<value>"
    host="electric-excess.name"
    port="36393"
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.general.get_server_info(request={})

    assert res.media_container_with_directory is not None

    # Handle response
    print(res.media_container_with_directory)

```

### Override Server URL Per-Client

The default server can also be overridden globally by passing a URL to the `server_url: str` optional parameter when initializing the SDK client instance. For example:
```python
from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    server_url="https://{full_server_url}",
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.general.get_server_info(request={})

    assert res.media_container_with_directory is not None

    # Handle response
    print(res.media_container_with_directory)

```
<!-- End Server Selection [server] -->

<!-- Start Custom HTTP Client [http-client] -->
## Custom HTTP Client

The Python SDK makes API calls using the [httpx](https://www.python-httpx.org/) HTTP library.  In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with your own HTTP client instance.
Depending on whether you are using the sync or async version of the SDK, you can pass an instance of `HttpClient` or `AsyncHttpClient` respectively, which are Protocol's ensuring that the client has the necessary methods to make API calls.
This allows you to wrap the client with your own custom logic, such as adding custom headers, logging, or error handling, or you can just pass an instance of `httpx.Client` or `httpx.AsyncClient` directly.

For example, you could specify a header for every request that this sdk makes as follows:
```python
from plex_api_client import PlexAPI
import httpx

http_client = httpx.Client(headers={"x-custom-header": "someValue"})
s = PlexAPI(client=http_client)
```

or you could wrap the client with your own custom logic:
```python
from plex_api_client import PlexAPI
from plex_api_client.httpclient import AsyncHttpClient
import httpx

class CustomClient(AsyncHttpClient):
    client: AsyncHttpClient

    def __init__(self, client: AsyncHttpClient):
        self.client = client

    async def send(
        self,
        request: httpx.Request,
        *,
        stream: bool = False,
        auth: Union[
            httpx._types.AuthTypes, httpx._client.UseClientDefault, None
        ] = httpx.USE_CLIENT_DEFAULT,
        follow_redirects: Union[
            bool, httpx._client.UseClientDefault
        ] = httpx.USE_CLIENT_DEFAULT,
    ) -> httpx.Response:
        request.headers["Client-Level-Header"] = "added by client"

        return await self.client.send(
            request, stream=stream, auth=auth, follow_redirects=follow_redirects
        )

    def build_request(
        self,
        method: str,
        url: httpx._types.URLTypes,
        *,
        content: Optional[httpx._types.RequestContent] = None,
        data: Optional[httpx._types.RequestData] = None,
        files: Optional[httpx._types.RequestFiles] = None,
        json: Optional[Any] = None,
        params: Optional[httpx._types.QueryParamTypes] = None,
        headers: Optional[httpx._types.HeaderTypes] = None,
        cookies: Optional[httpx._types.CookieTypes] = None,
        timeout: Union[
            httpx._types.TimeoutTypes, httpx._client.UseClientDefault
        ] = httpx.USE_CLIENT_DEFAULT,
        extensions: Optional[httpx._types.RequestExtensions] = None,
    ) -> httpx.Request:
        return self.client.build_request(
            method,
            url,
            content=content,
            data=data,
            files=files,
            json=json,
            params=params,
            headers=headers,
            cookies=cookies,
            timeout=timeout,
            extensions=extensions,
        )

s = PlexAPI(async_client=CustomClient(httpx.AsyncClient()))
```
<!-- End Custom HTTP Client [http-client] -->

<!-- Start Authentication [security] -->
## Authentication

### Per-Client Security Schemes

This SDK supports the following security scheme globally:

| Name    | Type   | Scheme  |
| ------- | ------ | ------- |
| `token` | apiKey | API key |

To authenticate with the API the `token` parameter must be set when initializing the SDK client instance. For example:
```python
from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    token="<YOUR_API_KEY_HERE>",
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
) as plex_api:

    res = plex_api.general.get_server_info(request={})

    assert res.media_container_with_directory is not None

    # Handle response
    print(res.media_container_with_directory)

```
<!-- End Authentication [security] -->

<!-- Start Resource Management [resource-management] -->
## Resource Management

The `PlexAPI` class implements the context manager protocol and registers a finalizer function to close the underlying sync and async HTTPX clients it uses under the hood. This will close HTTP connections, release memory and free up other resources held by the SDK. In short-lived Python programs and notebooks that make a few SDK method calls, resource management may not be a concern. However, in longer-lived programs, it is beneficial to create a single SDK instance via a [context manager][context-manager] and reuse it across the application.

[context-manager]: https://docs.python.org/3/reference/datamodel.html#context-managers

```python
from plex_api_client import PlexAPI
from plex_api_client.models import components
def main():

    with PlexAPI(
        accepts=components.Accepts.APPLICATION_XML,
        client_identifier="abc123",
        product="Plex for Roku",
        version="2.4.1",
        platform="Roku",
        platform_version="4.3 build 1057",
        device="Roku 3",
        model="4200X",
        device_vendor="Roku",
        device_name="Living Room TV",
        marketplace="googlePlay",
        token="<YOUR_API_KEY_HERE>",
    ) as plex_api:
        # Rest of application here...


# Or when using async:
async def amain():

    async with PlexAPI(
        accepts=components.Accepts.APPLICATION_XML,
        client_identifier="abc123",
        product="Plex for Roku",
        version="2.4.1",
        platform="Roku",
        platform_version="4.3 build 1057",
        device="Roku 3",
        model="4200X",
        device_vendor="Roku",
        device_name="Living Room TV",
        marketplace="googlePlay",
        token="<YOUR_API_KEY_HERE>",
    ) as plex_api:
        # Rest of application here...
```
<!-- End Resource Management [resource-management] -->

<!-- Start Debugging [debug] -->
## Debugging

You can setup your SDK to emit debug logs for SDK requests and responses.

You can pass your own logger class directly into your SDK.
```python
from plex_api_client import PlexAPI
import logging

logging.basicConfig(level=logging.DEBUG)
s = PlexAPI(debug_logger=logging.getLogger("plex_api_client"))
```
<!-- End Debugging [debug] -->

<!-- Placeholder for Future Speakeasy SDK Sections -->

# Development

## Maturity

This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage
to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally
looking for the latest version.

## Contributions

While we value open-source contributions to this SDK, this library is generated programmatically.
Feel free to open a PR or a Github issue as a proof of concept and we'll do our best to include it in a future release!

### SDK Created by [Speakeasy](https://docs.speakeasyapi.dev/docs/using-speakeasy/client-sdks)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/LukeHagar/plexpy.git",
    "name": "plex-api-client",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9.2",
    "maintainer_email": null,
    "keywords": null,
    "author": "Speakeasy",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/32/7b/6c8a15c2a0c1268e7305b4e7bc5248bf42ff35ee0a87ac34e7b5d15e76ed/plex_api_client-0.31.1.tar.gz",
    "platform": null,
    "description": "# plexpy\n\n<div align=\"left\">\n    <a href=\"https://speakeasyapi.dev/\"><img src=\"https://custom-icon-badges.demolab.com/badge/-Built%20By%20Speakeasy-212015?style=for-the-badge&logoColor=FBE331&logo=speakeasy&labelColor=545454\" /></a>\n    <a href=\"https://opensource.org/licenses/MIT\">\n        <img src=\"https://img.shields.io/badge/License-MIT-blue.svg\" style=\"width: 100px; height: 28px;\" />\n    </a>\n</div>\n\n<!-- Start Summary [summary] -->\n## Summary\n\n\n<!-- End Summary [summary] -->\n\n<!-- Start Table of Contents [toc] -->\n## Table of Contents\n<!-- $toc-max-depth=2 -->\n* [plexpy](https://github.com/LukeHagar/plexpy/blob/master/./#plexpy)\n  * [SDK Installation](https://github.com/LukeHagar/plexpy/blob/master/./#sdk-installation)\n  * [IDE Support](https://github.com/LukeHagar/plexpy/blob/master/./#ide-support)\n  * [SDK Example Usage](https://github.com/LukeHagar/plexpy/blob/master/./#sdk-example-usage)\n  * [Available Resources and Operations](https://github.com/LukeHagar/plexpy/blob/master/./#available-resources-and-operations)\n  * [File uploads](https://github.com/LukeHagar/plexpy/blob/master/./#file-uploads)\n  * [Retries](https://github.com/LukeHagar/plexpy/blob/master/./#retries)\n  * [Error Handling](https://github.com/LukeHagar/plexpy/blob/master/./#error-handling)\n  * [Server Selection](https://github.com/LukeHagar/plexpy/blob/master/./#server-selection)\n  * [Custom HTTP Client](https://github.com/LukeHagar/plexpy/blob/master/./#custom-http-client)\n  * [Authentication](https://github.com/LukeHagar/plexpy/blob/master/./#authentication)\n  * [Resource Management](https://github.com/LukeHagar/plexpy/blob/master/./#resource-management)\n  * [Debugging](https://github.com/LukeHagar/plexpy/blob/master/./#debugging)\n* [Development](https://github.com/LukeHagar/plexpy/blob/master/./#development)\n  * [Maturity](https://github.com/LukeHagar/plexpy/blob/master/./#maturity)\n  * [Contributions](https://github.com/LukeHagar/plexpy/blob/master/./#contributions)\n\n<!-- End Table of Contents [toc] -->\n\n<!-- Start SDK Installation [installation] -->\n## SDK Installation\n\n> [!NOTE]\n> **Python version upgrade policy**\n>\n> Once a Python version reaches its [official end of life date](https://devguide.python.org/versions/), a 3-month grace period is provided for users to upgrade. Following this grace period, the minimum python version supported in the SDK will be updated.\n\nThe SDK can be installed with *uv*, *pip*, or *poetry* package managers.\n\n### uv\n\n*uv* is a fast Python package installer and resolver, designed as a drop-in replacement for pip and pip-tools. It's recommended for its speed and modern Python tooling capabilities.\n\n```bash\nuv add plex-api-client\n```\n\n### PIP\n\n*PIP* is the default package installer for Python, enabling easy installation and management of packages from PyPI via the command line.\n\n```bash\npip install plex-api-client\n```\n\n### Poetry\n\n*Poetry* is a modern tool that simplifies dependency management and package publishing by using a single `pyproject.toml` file to handle project metadata and dependencies.\n\n```bash\npoetry add plex-api-client\n```\n\n### Shell and script usage with `uv`\n\nYou can use this SDK in a Python shell with [uv](https://docs.astral.sh/uv/) and the `uvx` command that comes with it like so:\n\n```shell\nuvx --from plex-api-client python\n```\n\nIt's also possible to write a standalone Python script without needing to set up a whole project like so:\n\n```python\n#!/usr/bin/env -S uv run --script\n# /// script\n# requires-python = \">=3.9\"\n# dependencies = [\n#     \"plex-api-client\",\n# ]\n# ///\n\nfrom plex_api_client import PlexAPI\n\nsdk = PlexAPI(\n  # SDK arguments\n)\n\n# Rest of script here...\n```\n\nOnce that is saved to a file, you can run it with `uv run script.py` where\n`script.py` can be replaced with the actual file name.\n<!-- End SDK Installation [installation] -->\n\n<!-- Start IDE Support [idesupport] -->\n## IDE Support\n\n### PyCharm\n\nGenerally, the SDK will work well with most IDEs out of the box. However, when using PyCharm, you can enjoy much better integration with Pydantic by installing an additional plugin.\n\n- [PyCharm Pydantic Plugin](https://docs.pydantic.dev/latest/integrations/pycharm/)\n<!-- End IDE Support [idesupport] -->\n\n<!-- Start SDK Example Usage [usage] -->\n## SDK Example Usage\n\n### Example\n\n```python\n# Synchronous Example\nfrom plex_api_client import PlexAPI\nfrom plex_api_client.models import components, operations\n\n\nwith PlexAPI(\n    accepts=components.Accepts.APPLICATION_XML,\n    client_identifier=\"abc123\",\n    product=\"Plex for Roku\",\n    version=\"2.4.1\",\n    platform=\"Roku\",\n    platform_version=\"4.3 build 1057\",\n    device=\"Roku 3\",\n    model=\"4200X\",\n    device_vendor=\"Roku\",\n    device_name=\"Living Room TV\",\n    marketplace=\"googlePlay\",\n    token=\"<YOUR_API_KEY_HERE>\",\n) as plex_api:\n\n    res = plex_api.transcoder.start_transcode_session(request=operations.StartTranscodeSessionRequest(\n        transcode_type=components.TranscodeType.MUSIC,\n        extension=operations.Extension.MPD,\n        advanced_subtitles=components.AdvancedSubtitles.BURN,\n        audio_boost=50,\n        audio_channel_count=5,\n        auto_adjust_quality=components.BoolInt.ONE,\n        auto_adjust_subtitle=components.BoolInt.ONE,\n        direct_play=components.BoolInt.ONE,\n        direct_stream=components.BoolInt.ONE,\n        direct_stream_audio=components.BoolInt.ONE,\n        disable_resolution_rotation=components.BoolInt.ONE,\n        has_mde=components.BoolInt.ONE,\n        location=operations.StartTranscodeSessionQueryParamLocation.WAN,\n        media_buffer_size=102400,\n        media_index=0,\n        music_bitrate=5000,\n        offset=90.5,\n        part_index=0,\n        path=\"/library/metadata/151671\",\n        peak_bitrate=12000,\n        photo_resolution=\"1080x1080\",\n        protocol=operations.StartTranscodeSessionQueryParamProtocol.DASH,\n        seconds_per_segment=5,\n        subtitle_size=50,\n        video_bitrate=12000,\n        video_quality=50,\n        video_resolution=\"1080x1080\",\n        x_plex_client_profile_extra=\"add-limitation(scope=videoCodec&scopeName=*&type=upperBound&name=video.frameRate&value=60&replace=true)+append-transcode-target-codec(type=videoProfile&context=streaming&videoCodec=h264%2Chevc&audioCodec=aac&protocol=dash)\",\n        x_plex_client_profile_name=\"generic\",\n    ))\n\n    assert res.response_stream is not None\n\n    # Handle response\n    print(res.response_stream)\n```\n\n</br>\n\nThe same SDK client can also be used to make asynchronous requests by importing asyncio.\n\n```python\n# Asynchronous Example\nimport asyncio\nfrom plex_api_client import PlexAPI\nfrom plex_api_client.models import components, operations\n\nasync def main():\n\n    async with PlexAPI(\n        accepts=components.Accepts.APPLICATION_XML,\n        client_identifier=\"abc123\",\n        product=\"Plex for Roku\",\n        version=\"2.4.1\",\n        platform=\"Roku\",\n        platform_version=\"4.3 build 1057\",\n        device=\"Roku 3\",\n        model=\"4200X\",\n        device_vendor=\"Roku\",\n        device_name=\"Living Room TV\",\n        marketplace=\"googlePlay\",\n        token=\"<YOUR_API_KEY_HERE>\",\n    ) as plex_api:\n\n        res = await plex_api.transcoder.start_transcode_session_async(request=operations.StartTranscodeSessionRequest(\n            transcode_type=components.TranscodeType.MUSIC,\n            extension=operations.Extension.MPD,\n            advanced_subtitles=components.AdvancedSubtitles.BURN,\n            audio_boost=50,\n            audio_channel_count=5,\n            auto_adjust_quality=components.BoolInt.ONE,\n            auto_adjust_subtitle=components.BoolInt.ONE,\n            direct_play=components.BoolInt.ONE,\n            direct_stream=components.BoolInt.ONE,\n            direct_stream_audio=components.BoolInt.ONE,\n            disable_resolution_rotation=components.BoolInt.ONE,\n            has_mde=components.BoolInt.ONE,\n            location=operations.StartTranscodeSessionQueryParamLocation.WAN,\n            media_buffer_size=102400,\n            media_index=0,\n            music_bitrate=5000,\n            offset=90.5,\n            part_index=0,\n            path=\"/library/metadata/151671\",\n            peak_bitrate=12000,\n            photo_resolution=\"1080x1080\",\n            protocol=operations.StartTranscodeSessionQueryParamProtocol.DASH,\n            seconds_per_segment=5,\n            subtitle_size=50,\n            video_bitrate=12000,\n            video_quality=50,\n            video_resolution=\"1080x1080\",\n            x_plex_client_profile_extra=\"add-limitation(scope=videoCodec&scopeName=*&type=upperBound&name=video.frameRate&value=60&replace=true)+append-transcode-target-codec(type=videoProfile&context=streaming&videoCodec=h264%2Chevc&audioCodec=aac&protocol=dash)\",\n            x_plex_client_profile_name=\"generic\",\n        ))\n\n        assert res.response_stream is not None\n\n        # Handle response\n        print(res.response_stream)\n\nasyncio.run(main())\n```\n<!-- End SDK Example Usage [usage] -->\n\n<!-- Start Available Resources and Operations [operations] -->\n## Available Resources and Operations\n\n<details open>\n<summary>Available methods</summary>\n\n### [activities](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/activities/README.md)\n\n* [list_activities](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/activities/README.md#list_activities) - Get all activities\n* [cancel_activity](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/activities/README.md#cancel_activity) - Cancel a running activity\n\n### [butler](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/butler/README.md)\n\n* [stop_tasks](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/butler/README.md#stop_tasks) - Stop all Butler tasks\n* [get_tasks](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/butler/README.md#get_tasks) - Get all Butler tasks\n* [start_tasks](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/butler/README.md#start_tasks) - Start all Butler tasks\n* [stop_task](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/butler/README.md#stop_task) - Stop a single Butler task\n* [start_task](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/butler/README.md#start_task) - Start a single Butler task\n\n### [collections](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/collections/README.md)\n\n* [create_collection](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/collections/README.md#create_collection) - Create collection\n\n### [content](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/content/README.md)\n\n* [get_collection_items](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/content/README.md#get_collection_items) - Get items in a collection\n* [get_metadata_item](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/content/README.md#get_metadata_item) - Get a metadata item\n* [get_albums](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/content/README.md#get_albums) - Set section albums\n* [list_content](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/content/README.md#list_content) - Get items in the section\n* [get_all_leaves](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/content/README.md#get_all_leaves) - Set section leaves\n* [get_arts](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/content/README.md#get_arts) - Set section artwork\n* [get_categories](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/content/README.md#get_categories) - Set section categories\n* [get_cluster](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/content/README.md#get_cluster) - Set section clusters\n* [get_sonic_path](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/content/README.md#get_sonic_path) - Similar tracks to transition from one to another\n* [get_folders](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/content/README.md#get_folders) - Get all folder locations\n* [list_moments](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/content/README.md#list_moments) - Set section moments\n* [get_sonically_similar](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/content/README.md#get_sonically_similar) - The nearest audio tracks\n* [get_collection_image](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/content/README.md#get_collection_image) - Get a collection's image\n\n### [devices](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/devices/README.md)\n\n* [get_available_grabbers](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/devices/README.md#get_available_grabbers) - Get available grabbers\n* [list_devices](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/devices/README.md#list_devices) - Get all devices\n* [add_device](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/devices/README.md#add_device) - Add a device\n* [discover_devices](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/devices/README.md#discover_devices) - Tell grabbers to discover devices\n* [remove_device](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/devices/README.md#remove_device) - Remove a device\n* [get_device_details](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/devices/README.md#get_device_details) - Get device details\n* [modify_device](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/devices/README.md#modify_device) - Enable or disable a device\n* [set_channelmap](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/devices/README.md#set_channelmap) - Set a device's channel mapping\n* [get_devices_channels](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/devices/README.md#get_devices_channels) - Get a device's channels\n* [set_device_preferences](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/devices/README.md#set_device_preferences) - Set device preferences\n* [stop_scan](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/devices/README.md#stop_scan) - Tell a device to stop scanning for channels\n* [scan](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/devices/README.md#scan) - Tell a device to scan for channels\n* [get_thumb](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/devices/README.md#get_thumb) - Get device thumb\n\n### [download_queue](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/downloadqueue/README.md)\n\n* [create_download_queue](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/downloadqueue/README.md#create_download_queue) - Create download queue\n* [get_download_queue](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/downloadqueue/README.md#get_download_queue) - Get a download queue\n* [add_download_queue_items](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/downloadqueue/README.md#add_download_queue_items) - Add to download queue\n* [list_download_queue_items](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/downloadqueue/README.md#list_download_queue_items) - Get download queue items\n* [get_item_decision](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/downloadqueue/README.md#get_item_decision) - Grab download queue item decision\n* [get_download_queue_media](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/downloadqueue/README.md#get_download_queue_media) - Grab download queue media\n* [remove_download_queue_items](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/downloadqueue/README.md#remove_download_queue_items) - Delete download queue items\n* [get_download_queue_items](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/downloadqueue/README.md#get_download_queue_items) - Get download queue items\n* [restart_processing_download_queue_items](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/downloadqueue/README.md#restart_processing_download_queue_items) - Restart processing of items from the decision\n\n### [dv_rs](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/dvrs/README.md)\n\n* [list_dv_rs](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/dvrs/README.md#list_dv_rs) - Get DVRs\n* [create_dvr](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/dvrs/README.md#create_dvr) - Create a DVR\n* [delete_dvr](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/dvrs/README.md#delete_dvr) - Delete a single DVR\n* [get_dvr](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/dvrs/README.md#get_dvr) - Get a single DVR\n* [delete_lineup](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/dvrs/README.md#delete_lineup) - Delete a DVR Lineup\n* [add_lineup](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/dvrs/README.md#add_lineup) - Add a DVR Lineup\n* [set_dvr_preferences](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/dvrs/README.md#set_dvr_preferences) - Set DVR preferences\n* [stop_dvr_reload](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/dvrs/README.md#stop_dvr_reload) - Tell a DVR to stop reloading program guide\n* [reload_guide](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/dvrs/README.md#reload_guide) - Tell a DVR to reload program guide\n* [tune_channel](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/dvrs/README.md#tune_channel) - Tune a channel on a DVR\n* [remove_device_from_dvr](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/dvrs/README.md#remove_device_from_dvr) - Remove a device from an existing DVR\n* [add_device_to_dvr](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/dvrs/README.md#add_device_to_dvr) - Add a device to an existing DVR\n\n### [epg](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/epg/README.md)\n\n* [compute_channel_map](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/epg/README.md#compute_channel_map) - Compute the best channel map\n* [get_channels](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/epg/README.md#get_channels) - Get channels for a lineup\n* [get_countries](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/epg/README.md#get_countries) - Get all countries\n* [get_all_languages](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/epg/README.md#get_all_languages) - Get all languages\n* [get_lineup](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/epg/README.md#get_lineup) - Compute the best lineup\n* [get_lineup_channels](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/epg/README.md#get_lineup_channels) - Get the channels for mulitple lineups\n* [get_countries_lineups](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/epg/README.md#get_countries_lineups) - Get lineups for a country via postal code\n* [get_country_regions](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/epg/README.md#get_country_regions) - Get regions for a country\n* [list_lineups](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/epg/README.md#list_lineups) - Get lineups for a region\n\n### [events](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/events/README.md)\n\n* [get_notifications](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/events/README.md#get_notifications) - Connect to Eventsource\n* [connect_web_socket](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/events/README.md#connect_web_socket) - Connect to WebSocket\n\n### [general](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/general/README.md)\n\n* [get_server_info](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/general/README.md#get_server_info) - Get PMS info\n* [get_identity](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/general/README.md#get_identity) - Get PMS identity\n* [get_source_connection_information](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/general/README.md#get_source_connection_information) - Get Source Connection Information\n* [get_transient_token](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/general/README.md#get_transient_token) - Get Transient Tokens\n\n### [hubs](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/hubs/README.md)\n\n* [get_all_hubs](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/hubs/README.md#get_all_hubs) - Get global hubs\n* [get_continue_watching](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/hubs/README.md#get_continue_watching) - Get the continue watching hub\n* [get_hub_items](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/hubs/README.md#get_hub_items) - Get a hub's items\n* [get_promoted_hubs](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/hubs/README.md#get_promoted_hubs) - Get the hubs which are promoted\n* [get_metadata_hubs](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/hubs/README.md#get_metadata_hubs) - Get hubs for section by metadata item\n* [get_postplay_hubs](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/hubs/README.md#get_postplay_hubs) - Get postplay hubs\n* [get_related_hubs](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/hubs/README.md#get_related_hubs) - Get related hubs\n* [get_section_hubs](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/hubs/README.md#get_section_hubs) - Get section hubs\n* [reset_section_defaults](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/hubs/README.md#reset_section_defaults) - Reset hubs to defaults\n* [list_hubs](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/hubs/README.md#list_hubs) - Get hubs\n* [create_custom_hub](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/hubs/README.md#create_custom_hub) - Create a custom hub\n* [move_hub](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/hubs/README.md#move_hub) - Move Hub\n* [delete_custom_hub](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/hubs/README.md#delete_custom_hub) - Delete a custom hub\n* [update_hub_visibility](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/hubs/README.md#update_hub_visibility) - Change hub visibility\n\n### [library](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md)\n\n* [get_library_items](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_library_items) - Get all items in library\n* [delete_caches](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#delete_caches) - Delete library caches\n* [clean_bundles](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#clean_bundles) - Clean bundles\n* [ingest_transient_item](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#ingest_transient_item) - Ingest a transient item\n* [get_library_matches](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_library_matches) - Get library matches\n* [optimize_database](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#optimize_database) - Optimize the Database\n* [get_random_artwork](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_random_artwork) - Get random artwork\n* [get_sections](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_sections) - Get library sections (main Media Provider Only)\n* [add_section](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#add_section) - Add a library section\n* [stop_all_refreshes](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#stop_all_refreshes) - Stop refresh\n* [get_sections_prefs](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_sections_prefs) - Get section prefs\n* [refresh_sections_metadata](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#refresh_sections_metadata) - Refresh all sections\n* [get_tags](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_tags) - Get all library tags of a type\n* [delete_metadata_item](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#delete_metadata_item) - Delete a metadata item\n* [edit_metadata_item](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#edit_metadata_item) - Edit a metadata item\n* [detect_ads](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#detect_ads) - Ad-detect an item\n* [get_all_item_leaves](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_all_item_leaves) - Get the leaves of an item\n* [analyze_metadata](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#analyze_metadata) - Analyze an item\n* [generate_thumbs](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#generate_thumbs) - Generate thumbs of chapters for an item\n* [detect_credits](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#detect_credits) - Credit detect a metadata item\n* [get_extras](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_extras) - Get an item's extras\n* [add_extras](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#add_extras) - Add to an item's extras\n* [get_file](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_file) - Get a file from a metadata or media bundle\n* [start_bif_generation](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#start_bif_generation) - Start BIF generation of an item\n* [detect_intros](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#detect_intros) - Intro detect an item\n* [create_marker](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#create_marker) - Create a marker\n* [match_item](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#match_item) - Match a metadata item\n* [list_matches](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#list_matches) - Get metadata matches for an item\n* [merge_items](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#merge_items) - Merge a metadata item\n* [list_sonically_similar](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#list_sonically_similar) - Get nearest tracks to metadata item\n* [set_item_preferences](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#set_item_preferences) - Set metadata preferences\n* [refresh_items_metadata](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#refresh_items_metadata) - Refresh a metadata item\n* [get_related_items](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_related_items) - Get related items\n* [list_similar](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#list_similar) - Get similar items\n* [split_item](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#split_item) - Split a metadata item\n* [add_subtitles](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#add_subtitles) - Add subtitles\n* [get_item_tree](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_item_tree) - Get metadata items as a tree\n* [unmatch](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#unmatch) - Unmatch a metadata item\n* [list_top_users](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#list_top_users) - Get metadata top users\n* [detect_voice_activity](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#detect_voice_activity) - Detect voice activity\n* [get_augmentation_status](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_augmentation_status) - Get augmentation status\n* [set_stream_selection](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#set_stream_selection) - Set stream selection\n* [get_person](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_person) - Get person details\n* [list_person_media](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#list_person_media) - Get media for a person\n* [delete_library_section](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#delete_library_section) - Delete a library section\n* [get_library_details](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_library_details) - Get a library section by id\n* [edit_section](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#edit_section) - Edit a library section\n* [update_items](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#update_items) - Set the fields of the filtered items\n* [start_analysis](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#start_analysis) - Analyze a section\n* [autocomplete](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#autocomplete) - Get autocompletions for search\n* [get_collections](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_collections) - Get collections in a section\n* [get_common](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_common) - Get common fields for items\n* [empty_trash](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#empty_trash) - Empty section trash\n* [get_section_filters](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_section_filters) - Get section filters\n* [get_first_characters](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_first_characters) - Get list of first characters\n* [delete_indexes](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#delete_indexes) - Delete section indexes\n* [delete_intros](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#delete_intros) - Delete section intro markers\n* [get_section_preferences](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_section_preferences) - Get section prefs\n* [set_section_preferences](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#set_section_preferences) - Set section prefs\n* [cancel_refresh](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#cancel_refresh) - Cancel section refresh\n* [refresh_section](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#refresh_section) - Refresh section\n* [get_available_sorts](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_available_sorts) - Get a section sorts\n* [get_stream_levels](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_stream_levels) - Get loudness about a stream in json\n* [get_stream_loudness](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_stream_loudness) - Get loudness about a stream\n* [get_chapter_image](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_chapter_image) - Get a chapter image\n* [set_item_artwork](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#set_item_artwork) - Set an item's artwork, theme, etc\n* [update_item_artwork](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#update_item_artwork) - Set an item's artwork, theme, etc\n* [delete_marker](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#delete_marker) - Delete a marker\n* [edit_marker](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#edit_marker) - Edit a marker\n* [delete_media_item](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#delete_media_item) - Delete a media item\n* [get_part_index](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_part_index) - Get BIF index for a part\n* [delete_collection](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#delete_collection) - Delete a collection\n* [get_section_image](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_section_image) - Get a section composite image\n* [delete_stream](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#delete_stream) - Delete a stream\n* [get_stream](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_stream) - Get a stream\n* [set_stream_offset](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#set_stream_offset) - Set a stream offset\n* [get_item_artwork](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_item_artwork) - Get an item's artwork, theme, etc\n* [get_media_part](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_media_part) - Get a media part\n* [get_image_from_bif](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/library/README.md#get_image_from_bif) - Get an image from part BIF\n\n### [library_collections](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/librarycollections/README.md)\n\n* [add_collection_items](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/librarycollections/README.md#add_collection_items) - Add items to a collection\n* [delete_collection_item](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/librarycollections/README.md#delete_collection_item) - Delete an item from a collection\n* [move_collection_item](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/librarycollections/README.md#move_collection_item) - Reorder an item in the collection\n\n### [library_playlists](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/libraryplaylists/README.md)\n\n* [create_playlist](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/libraryplaylists/README.md#create_playlist) - Create a Playlist\n* [upload_playlist](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/libraryplaylists/README.md#upload_playlist) - Upload\n* [delete_playlist](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/libraryplaylists/README.md#delete_playlist) - Delete a Playlist\n* [update_playlist](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/libraryplaylists/README.md#update_playlist) - Editing a Playlist\n* [get_playlist_generators](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/libraryplaylists/README.md#get_playlist_generators) - Get a playlist's generators\n* [clear_playlist_items](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/libraryplaylists/README.md#clear_playlist_items) - Clearing a playlist\n* [add_playlist_items](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/libraryplaylists/README.md#add_playlist_items) - Adding to  a Playlist\n* [delete_playlist_item](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/libraryplaylists/README.md#delete_playlist_item) - Delete a Generator\n* [get_playlist_generator](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/libraryplaylists/README.md#get_playlist_generator) - Get a playlist generator\n* [modify_playlist_generator](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/libraryplaylists/README.md#modify_playlist_generator) - Modify a Generator\n* [get_playlist_generator_items](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/libraryplaylists/README.md#get_playlist_generator_items) - Get a playlist generator's items\n* [move_playlist_item](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/libraryplaylists/README.md#move_playlist_item) - Moving items in a playlist\n* [refresh_playlist](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/libraryplaylists/README.md#refresh_playlist) - Reprocess a generator\n\n### [live_tv](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/livetv/README.md)\n\n* [get_sessions](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/livetv/README.md#get_sessions) - Get all sessions\n* [get_live_tv_session](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/livetv/README.md#get_live_tv_session) - Get a single session\n* [get_session_playlist_index](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/livetv/README.md#get_session_playlist_index) - Get a session playlist index\n* [get_session_segment](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/livetv/README.md#get_session_segment) - Get a single session segment\n\n### [log](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/log/README.md)\n\n* [write_log](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/log/README.md#write_log) - Logging a multi-line message to the Plex Media Server log\n* [write_message](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/log/README.md#write_message) - Logging a single-line message to the Plex Media Server log\n* [enable_papertrail](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/log/README.md#enable_papertrail) - Enabling Papertrail\n\n### [play_queue](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/playqueue/README.md)\n\n* [create_play_queue](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/playqueue/README.md#create_play_queue) - Create a play queue\n* [get_play_queue](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/playqueue/README.md#get_play_queue) - Retrieve a play queue\n* [add_to_play_queue](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/playqueue/README.md#add_to_play_queue) - Add a generator or playlist to a play queue\n* [clear_play_queue](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/playqueue/README.md#clear_play_queue) - Clear a play queue\n* [reset_play_queue](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/playqueue/README.md#reset_play_queue) - Reset a play queue\n* [shuffle](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/playqueue/README.md#shuffle) - Shuffle a play queue\n* [unshuffle](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/playqueue/README.md#unshuffle) - Unshuffle a play queue\n* [delete_play_queue_item](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/playqueue/README.md#delete_play_queue_item) - Delete an item from a play queue\n* [move_play_queue_item](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/playqueue/README.md#move_play_queue_item) - Move an item in a play queue\n\n### [playlist](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/playlist/README.md)\n\n* [list_playlists](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/playlist/README.md#list_playlists) - List playlists\n* [get_playlist](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/playlist/README.md#get_playlist) - Retrieve Playlist\n* [get_playlist_items](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/playlist/README.md#get_playlist_items) - Retrieve Playlist Contents\n\n### [preferences](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/preferences/README.md)\n\n* [get_all_preferences](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/preferences/README.md#get_all_preferences) - Get all preferences\n* [set_preferences](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/preferences/README.md#set_preferences) - Set preferences\n* [get_preference](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/preferences/README.md#get_preference) - Get a preferences\n\n### [provider](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/provider/README.md)\n\n* [list_providers](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/provider/README.md#list_providers) - Get the list of available media providers\n* [add_provider](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/provider/README.md#add_provider) - Add a media provider\n* [refresh_providers](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/provider/README.md#refresh_providers) - Refresh media providers\n* [delete_media_provider](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/provider/README.md#delete_media_provider) - Delete a media provider\n\n### [rate](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/rate/README.md)\n\n* [set_rating](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/rate/README.md#set_rating) - Rate an item\n\n### [search](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/search/README.md)\n\n* [search_hubs](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/search/README.md#search_hubs) - Search Hub\n* [voice_search_hubs](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/search/README.md#voice_search_hubs) - Voice Search Hub\n\n### [status](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/status/README.md)\n\n* [list_sessions](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/status/README.md#list_sessions) - List Sessions\n* [get_background_tasks](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/status/README.md#get_background_tasks) - Get background tasks\n* [list_playback_history](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/status/README.md#list_playback_history) - List Playback History\n* [terminate_session](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/status/README.md#terminate_session) - Terminate a session\n* [delete_history](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/status/README.md#delete_history) - Delete Single History Item\n* [get_history_item](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/status/README.md#get_history_item) - Get Single History Item\n\n### [subscriptions](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/subscriptions/README.md)\n\n* [get_all_subscriptions](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/subscriptions/README.md#get_all_subscriptions) - Get all subscriptions\n* [create_subscription](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/subscriptions/README.md#create_subscription) - Create a subscription\n* [process_subscriptions](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/subscriptions/README.md#process_subscriptions) - Process all subscriptions\n* [get_scheduled_recordings](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/subscriptions/README.md#get_scheduled_recordings) - Get all scheduled recordings\n* [get_template](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/subscriptions/README.md#get_template) - Get the subscription template\n* [cancel_grab](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/subscriptions/README.md#cancel_grab) - Cancel an existing grab\n* [delete_subscription](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/subscriptions/README.md#delete_subscription) - Delete a subscription\n* [get_subscription](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/subscriptions/README.md#get_subscription) - Get a single subscription\n* [edit_subscription_preferences](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/subscriptions/README.md#edit_subscription_preferences) - Edit a subscription\n* [reorder_subscription](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/subscriptions/README.md#reorder_subscription) - Re-order a subscription\n\n### [timeline](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/timeline/README.md)\n\n* [mark_played](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/timeline/README.md#mark_played) - Mark an item as played\n* [report](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/timeline/README.md#report) - Report media timeline\n* [unscrobble](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/timeline/README.md#unscrobble) - Mark an item as unplayed\n\n### [transcoder](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/transcoder/README.md)\n\n* [transcode_image](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/transcoder/README.md#transcode_image) - Transcode an image\n* [make_decision](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/transcoder/README.md#make_decision) - Make a decision on media playback\n* [trigger_fallback](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/transcoder/README.md#trigger_fallback) - Manually trigger a transcoder fallback\n* [transcode_subtitles](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/transcoder/README.md#transcode_subtitles) - Transcode subtitles\n* [start_transcode_session](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/transcoder/README.md#start_transcode_session) - Start A Transcoding Session\n\n### [ultra_blur](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/ultrablur/README.md)\n\n* [get_colors](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/ultrablur/README.md#get_colors) - Get UltraBlur Colors\n* [get_image](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/ultrablur/README.md#get_image) - Get UltraBlur Image\n\n### [updater](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/updater/README.md)\n\n* [apply_updates](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/updater/README.md#apply_updates) - Applying updates\n* [check_updates](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/updater/README.md#check_updates) - Checking for updates\n* [get_updates_status](https://github.com/LukeHagar/plexpy/blob/master/./docs/sdks/updater/README.md#get_updates_status) - Querying status of updates\n\n</details>\n<!-- End Available Resources and Operations [operations] -->\n\n<!-- Start File uploads [file-upload] -->\n## File uploads\n\nCertain SDK methods accept file objects as part of a request body or multi-part request. It is possible and typically recommended to upload files as a stream rather than reading the entire contents into memory. This avoids excessive memory consumption and potentially crashing with out-of-memory errors when working with very large files. The following example demonstrates how to attach a file stream to a request.\n\n> [!TIP]\n>\n> For endpoints that handle file uploads bytes arrays can also be used. However, using streams is recommended for large files.\n>\n\n```python\nfrom plex_api_client import PlexAPI\n\n\nwith PlexAPI(\n    token=\"<YOUR_API_KEY_HERE>\",\n) as plex_api:\n\n    res = plex_api.log.write_log(request=open(\"example.file\", \"rb\"))\n\n    assert res is not None\n\n    # Handle response\n    print(res)\n\n```\n<!-- End File uploads [file-upload] -->\n\n<!-- Start Retries [retries] -->\n## Retries\n\nSome of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.\n\nTo change the default retry strategy for a single API call, simply provide a `RetryConfig` object to the call:\n```python\nfrom plex_api_client import PlexAPI\nfrom plex_api_client.models import components\nfrom plex_api_client.utils import BackoffStrategy, RetryConfig\n\n\nwith PlexAPI(\n    accepts=components.Accepts.APPLICATION_XML,\n    client_identifier=\"abc123\",\n    product=\"Plex for Roku\",\n    version=\"2.4.1\",\n    platform=\"Roku\",\n    platform_version=\"4.3 build 1057\",\n    device=\"Roku 3\",\n    model=\"4200X\",\n    device_vendor=\"Roku\",\n    device_name=\"Living Room TV\",\n    marketplace=\"googlePlay\",\n    token=\"<YOUR_API_KEY_HERE>\",\n) as plex_api:\n\n    res = plex_api.general.get_server_info(request={},\n        RetryConfig(\"backoff\", BackoffStrategy(1, 50, 1.1, 100), False))\n\n    assert res.media_container_with_directory is not None\n\n    # Handle response\n    print(res.media_container_with_directory)\n\n```\n\nIf you'd like to override the default retry strategy for all operations that support retries, you can use the `retry_config` optional parameter when initializing the SDK:\n```python\nfrom plex_api_client import PlexAPI\nfrom plex_api_client.models import components\nfrom plex_api_client.utils import BackoffStrategy, RetryConfig\n\n\nwith PlexAPI(\n    retry_config=RetryConfig(\"backoff\", BackoffStrategy(1, 50, 1.1, 100), False),\n    accepts=components.Accepts.APPLICATION_XML,\n    client_identifier=\"abc123\",\n    product=\"Plex for Roku\",\n    version=\"2.4.1\",\n    platform=\"Roku\",\n    platform_version=\"4.3 build 1057\",\n    device=\"Roku 3\",\n    model=\"4200X\",\n    device_vendor=\"Roku\",\n    device_name=\"Living Room TV\",\n    marketplace=\"googlePlay\",\n    token=\"<YOUR_API_KEY_HERE>\",\n) as plex_api:\n\n    res = plex_api.general.get_server_info(request={})\n\n    assert res.media_container_with_directory is not None\n\n    # Handle response\n    print(res.media_container_with_directory)\n\n```\n<!-- End Retries [retries] -->\n\n<!-- Start Error Handling [errors] -->\n## Error Handling\n\n[`PlexAPIError`](https://github.com/LukeHagar/plexpy/blob/master/././src/plex_api_client/models/errors/plexapierror.py) is the base class for all HTTP error responses. It has the following properties:\n\n| Property           | Type             | Description                                            |\n| ------------------ | ---------------- | ------------------------------------------------------ |\n| `err.message`      | `str`            | Error message                                          |\n| `err.status_code`  | `int`            | HTTP response status code eg `404`                     |\n| `err.headers`      | `httpx.Headers`  | HTTP response headers                                  |\n| `err.body`         | `str`            | HTTP body. Can be empty string if no body is returned. |\n| `err.raw_response` | `httpx.Response` | Raw HTTP response                                      |\n\n### Example\n```python\nfrom plex_api_client import PlexAPI\nfrom plex_api_client.models import components, errors\n\n\nwith PlexAPI(\n    accepts=components.Accepts.APPLICATION_XML,\n    client_identifier=\"abc123\",\n    product=\"Plex for Roku\",\n    version=\"2.4.1\",\n    platform=\"Roku\",\n    platform_version=\"4.3 build 1057\",\n    device=\"Roku 3\",\n    model=\"4200X\",\n    device_vendor=\"Roku\",\n    device_name=\"Living Room TV\",\n    marketplace=\"googlePlay\",\n    token=\"<YOUR_API_KEY_HERE>\",\n) as plex_api:\n    res = None\n    try:\n\n        res = plex_api.general.get_server_info(request={})\n\n        assert res.media_container_with_directory is not None\n\n        # Handle response\n        print(res.media_container_with_directory)\n\n\n    except errors.PlexAPIError as e:\n        # The base class for HTTP error responses\n        print(e.message)\n        print(e.status_code)\n        print(e.body)\n        print(e.headers)\n        print(e.raw_response)\n\n```\n\n### Error Classes\n**Primary error:**\n* [`PlexAPIError`](https://github.com/LukeHagar/plexpy/blob/master/././src/plex_api_client/models/errors/plexapierror.py): The base class for HTTP error responses.\n\n<details><summary>Less common errors (5)</summary>\n\n<br />\n\n**Network errors:**\n* [`httpx.RequestError`](https://www.python-httpx.org/exceptions/#httpx.RequestError): Base class for request errors.\n    * [`httpx.ConnectError`](https://www.python-httpx.org/exceptions/#httpx.ConnectError): HTTP client was unable to make a request to a server.\n    * [`httpx.TimeoutException`](https://www.python-httpx.org/exceptions/#httpx.TimeoutException): HTTP request timed out.\n\n\n**Inherit from [`PlexAPIError`](https://github.com/LukeHagar/plexpy/blob/master/././src/plex_api_client/models/errors/plexapierror.py)**:\n* [`ResponseValidationError`](https://github.com/LukeHagar/plexpy/blob/master/././src/plex_api_client/models/errors/responsevalidationerror.py): Type mismatch between the response data and the expected Pydantic model. Provides access to the Pydantic validation error via the `cause` attribute.\n\n</details>\n<!-- End Error Handling [errors] -->\n\n<!-- Start Server Selection [server] -->\n## Server Selection\n\n### Select Server by Index\n\nYou can override the default server globally by passing a server index to the `server_idx: int` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:\n\n| #   | Server                                                     | Variables                                    | Description |\n| --- | ---------------------------------------------------------- | -------------------------------------------- | ----------- |\n| 0   | `https://{IP-description}.{identifier}.plex.direct:{port}` | `identifier`<br/>`IP-description`<br/>`port` |             |\n| 1   | `{protocol}://{host}:{port}`                               | `protocol`<br/>`host`<br/>`port`             |             |\n| 2   | `https://{full_server_url}`                                | `server_url`                                 |             |\n\nIf the selected server has variables, you may override its default values through the additional parameters made available in the SDK constructor:\n\n| Variable         | Parameter                | Default                              | Description                                                                                                                                                                                                                                                                                                                                                                          |\n| ---------------- | ------------------------ | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| `identifier`     | `identifier: str`        | `\"0123456789abcdef0123456789abcdef\"` | The unique identifier of this particular PMS                                                                                                                                                                                                                                                                                                                                         |\n| `IP-description` | `ip_description: str`    | `\"1-2-3-4\"`                          | A `-` separated string of the IPv4 or IPv6 address components                                                                                                                                                                                                                                                                                                                        |\n| `port`           | `port: str`              | `\"32400\"`                            | The Port number configured on the PMS. Typically (`32400`). <br/>If using a reverse proxy, this would be the port number configured on the proxy.<br/>                                                                                                                                                                                                                               |\n| `protocol`       | `protocol: str`          | `\"http\"`                             | The network protocol to use. Typically (`http` or `https`)                                                                                                                                                                                                                                                                                                                           |\n| `host`           | `host: str`              | `\"localhost\"`                        | The Host of the PMS.<br/>If using on a local network, this is the internal IP address of the server hosting the PMS.<br/>If using on an external network, this is the external IP address for your network, and requires port forwarding.<br/>If using a reverse proxy, this would be the external DNS domain for your network, and requires the proxy handle port forwarding. <br/> |\n| `server_url`     | `server_url_global: str` | `\"http://localhost:32400\"`           | The full manual URL to access the PMS                                                                                                                                                                                                                                                                                                                                                |\n\n#### Example\n\n```python\nfrom plex_api_client import PlexAPI\nfrom plex_api_client.models import components\n\n\nwith PlexAPI(\n    server_idx=1,\n    protocol=\"<value>\"\n    host=\"electric-excess.name\"\n    port=\"36393\"\n    accepts=components.Accepts.APPLICATION_XML,\n    client_identifier=\"abc123\",\n    product=\"Plex for Roku\",\n    version=\"2.4.1\",\n    platform=\"Roku\",\n    platform_version=\"4.3 build 1057\",\n    device=\"Roku 3\",\n    model=\"4200X\",\n    device_vendor=\"Roku\",\n    device_name=\"Living Room TV\",\n    marketplace=\"googlePlay\",\n    token=\"<YOUR_API_KEY_HERE>\",\n) as plex_api:\n\n    res = plex_api.general.get_server_info(request={})\n\n    assert res.media_container_with_directory is not None\n\n    # Handle response\n    print(res.media_container_with_directory)\n\n```\n\n### Override Server URL Per-Client\n\nThe default server can also be overridden globally by passing a URL to the `server_url: str` optional parameter when initializing the SDK client instance. For example:\n```python\nfrom plex_api_client import PlexAPI\nfrom plex_api_client.models import components\n\n\nwith PlexAPI(\n    server_url=\"https://{full_server_url}\",\n    accepts=components.Accepts.APPLICATION_XML,\n    client_identifier=\"abc123\",\n    product=\"Plex for Roku\",\n    version=\"2.4.1\",\n    platform=\"Roku\",\n    platform_version=\"4.3 build 1057\",\n    device=\"Roku 3\",\n    model=\"4200X\",\n    device_vendor=\"Roku\",\n    device_name=\"Living Room TV\",\n    marketplace=\"googlePlay\",\n    token=\"<YOUR_API_KEY_HERE>\",\n) as plex_api:\n\n    res = plex_api.general.get_server_info(request={})\n\n    assert res.media_container_with_directory is not None\n\n    # Handle response\n    print(res.media_container_with_directory)\n\n```\n<!-- End Server Selection [server] -->\n\n<!-- Start Custom HTTP Client [http-client] -->\n## Custom HTTP Client\n\nThe Python SDK makes API calls using the [httpx](https://www.python-httpx.org/) HTTP library.  In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with your own HTTP client instance.\nDepending on whether you are using the sync or async version of the SDK, you can pass an instance of `HttpClient` or `AsyncHttpClient` respectively, which are Protocol's ensuring that the client has the necessary methods to make API calls.\nThis allows you to wrap the client with your own custom logic, such as adding custom headers, logging, or error handling, or you can just pass an instance of `httpx.Client` or `httpx.AsyncClient` directly.\n\nFor example, you could specify a header for every request that this sdk makes as follows:\n```python\nfrom plex_api_client import PlexAPI\nimport httpx\n\nhttp_client = httpx.Client(headers={\"x-custom-header\": \"someValue\"})\ns = PlexAPI(client=http_client)\n```\n\nor you could wrap the client with your own custom logic:\n```python\nfrom plex_api_client import PlexAPI\nfrom plex_api_client.httpclient import AsyncHttpClient\nimport httpx\n\nclass CustomClient(AsyncHttpClient):\n    client: AsyncHttpClient\n\n    def __init__(self, client: AsyncHttpClient):\n        self.client = client\n\n    async def send(\n        self,\n        request: httpx.Request,\n        *,\n        stream: bool = False,\n        auth: Union[\n            httpx._types.AuthTypes, httpx._client.UseClientDefault, None\n        ] = httpx.USE_CLIENT_DEFAULT,\n        follow_redirects: Union[\n            bool, httpx._client.UseClientDefault\n        ] = httpx.USE_CLIENT_DEFAULT,\n    ) -> httpx.Response:\n        request.headers[\"Client-Level-Header\"] = \"added by client\"\n\n        return await self.client.send(\n            request, stream=stream, auth=auth, follow_redirects=follow_redirects\n        )\n\n    def build_request(\n        self,\n        method: str,\n        url: httpx._types.URLTypes,\n        *,\n        content: Optional[httpx._types.RequestContent] = None,\n        data: Optional[httpx._types.RequestData] = None,\n        files: Optional[httpx._types.RequestFiles] = None,\n        json: Optional[Any] = None,\n        params: Optional[httpx._types.QueryParamTypes] = None,\n        headers: Optional[httpx._types.HeaderTypes] = None,\n        cookies: Optional[httpx._types.CookieTypes] = None,\n        timeout: Union[\n            httpx._types.TimeoutTypes, httpx._client.UseClientDefault\n        ] = httpx.USE_CLIENT_DEFAULT,\n        extensions: Optional[httpx._types.RequestExtensions] = None,\n    ) -> httpx.Request:\n        return self.client.build_request(\n            method,\n            url,\n            content=content,\n            data=data,\n            files=files,\n            json=json,\n            params=params,\n            headers=headers,\n            cookies=cookies,\n            timeout=timeout,\n            extensions=extensions,\n        )\n\ns = PlexAPI(async_client=CustomClient(httpx.AsyncClient()))\n```\n<!-- End Custom HTTP Client [http-client] -->\n\n<!-- Start Authentication [security] -->\n## Authentication\n\n### Per-Client Security Schemes\n\nThis SDK supports the following security scheme globally:\n\n| Name    | Type   | Scheme  |\n| ------- | ------ | ------- |\n| `token` | apiKey | API key |\n\nTo authenticate with the API the `token` parameter must be set when initializing the SDK client instance. For example:\n```python\nfrom plex_api_client import PlexAPI\nfrom plex_api_client.models import components\n\n\nwith PlexAPI(\n    token=\"<YOUR_API_KEY_HERE>\",\n    accepts=components.Accepts.APPLICATION_XML,\n    client_identifier=\"abc123\",\n    product=\"Plex for Roku\",\n    version=\"2.4.1\",\n    platform=\"Roku\",\n    platform_version=\"4.3 build 1057\",\n    device=\"Roku 3\",\n    model=\"4200X\",\n    device_vendor=\"Roku\",\n    device_name=\"Living Room TV\",\n    marketplace=\"googlePlay\",\n) as plex_api:\n\n    res = plex_api.general.get_server_info(request={})\n\n    assert res.media_container_with_directory is not None\n\n    # Handle response\n    print(res.media_container_with_directory)\n\n```\n<!-- End Authentication [security] -->\n\n<!-- Start Resource Management [resource-management] -->\n## Resource Management\n\nThe `PlexAPI` class implements the context manager protocol and registers a finalizer function to close the underlying sync and async HTTPX clients it uses under the hood. This will close HTTP connections, release memory and free up other resources held by the SDK. In short-lived Python programs and notebooks that make a few SDK method calls, resource management may not be a concern. However, in longer-lived programs, it is beneficial to create a single SDK instance via a [context manager][context-manager] and reuse it across the application.\n\n[context-manager]: https://docs.python.org/3/reference/datamodel.html#context-managers\n\n```python\nfrom plex_api_client import PlexAPI\nfrom plex_api_client.models import components\ndef main():\n\n    with PlexAPI(\n        accepts=components.Accepts.APPLICATION_XML,\n        client_identifier=\"abc123\",\n        product=\"Plex for Roku\",\n        version=\"2.4.1\",\n        platform=\"Roku\",\n        platform_version=\"4.3 build 1057\",\n        device=\"Roku 3\",\n        model=\"4200X\",\n        device_vendor=\"Roku\",\n        device_name=\"Living Room TV\",\n        marketplace=\"googlePlay\",\n        token=\"<YOUR_API_KEY_HERE>\",\n    ) as plex_api:\n        # Rest of application here...\n\n\n# Or when using async:\nasync def amain():\n\n    async with PlexAPI(\n        accepts=components.Accepts.APPLICATION_XML,\n        client_identifier=\"abc123\",\n        product=\"Plex for Roku\",\n        version=\"2.4.1\",\n        platform=\"Roku\",\n        platform_version=\"4.3 build 1057\",\n        device=\"Roku 3\",\n        model=\"4200X\",\n        device_vendor=\"Roku\",\n        device_name=\"Living Room TV\",\n        marketplace=\"googlePlay\",\n        token=\"<YOUR_API_KEY_HERE>\",\n    ) as plex_api:\n        # Rest of application here...\n```\n<!-- End Resource Management [resource-management] -->\n\n<!-- Start Debugging [debug] -->\n## Debugging\n\nYou can setup your SDK to emit debug logs for SDK requests and responses.\n\nYou can pass your own logger class directly into your SDK.\n```python\nfrom plex_api_client import PlexAPI\nimport logging\n\nlogging.basicConfig(level=logging.DEBUG)\ns = PlexAPI(debug_logger=logging.getLogger(\"plex_api_client\"))\n```\n<!-- End Debugging [debug] -->\n\n<!-- Placeholder for Future Speakeasy SDK Sections -->\n\n# Development\n\n## Maturity\n\nThis SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage\nto a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally\nlooking for the latest version.\n\n## Contributions\n\nWhile we value open-source contributions to this SDK, this library is generated programmatically.\nFeel free to open a PR or a Github issue as a proof of concept and we'll do our best to include it in a future release!\n\n### SDK Created by [Speakeasy](https://docs.speakeasyapi.dev/docs/using-speakeasy/client-sdks)\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Python Client SDK Generated by Speakeasy",
    "version": "0.31.1",
    "project_urls": {
        "Homepage": "https://github.com/LukeHagar/plexpy.git",
        "Repository": "https://github.com/LukeHagar/plexpy.git"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f0b7d530fa8df656688ea07636a0b912f7cda5ccedfdaca982e9258dd14190bd",
                "md5": "6d07972c47df8325ec7c574a56b4f38f",
                "sha256": "a8bc180e69e09691930eb1a47825ad52c0a9d32a93f062e86f6e8852677a941b"
            },
            "downloads": -1,
            "filename": "plex_api_client-0.31.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6d07972c47df8325ec7c574a56b4f38f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9.2",
            "size": 629765,
            "upload_time": "2025-10-13T00:04:31",
            "upload_time_iso_8601": "2025-10-13T00:04:31.668136Z",
            "url": "https://files.pythonhosted.org/packages/f0/b7/d530fa8df656688ea07636a0b912f7cda5ccedfdaca982e9258dd14190bd/plex_api_client-0.31.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "327b6c8a15c2a0c1268e7305b4e7bc5248bf42ff35ee0a87ac34e7b5d15e76ed",
                "md5": "1dc60025af45ff1111a771f17672f457",
                "sha256": "6290b78a883637245df8dbe6125b93560a1011467424c7ff15243f43e90948be"
            },
            "downloads": -1,
            "filename": "plex_api_client-0.31.1.tar.gz",
            "has_sig": false,
            "md5_digest": "1dc60025af45ff1111a771f17672f457",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9.2",
            "size": 287368,
            "upload_time": "2025-10-13T00:04:33",
            "upload_time_iso_8601": "2025-10-13T00:04:33.260962Z",
            "url": "https://files.pythonhosted.org/packages/32/7b/6c8a15c2a0c1268e7305b4e7bc5248bf42ff35ee0a87ac34e7b5d15e76ed/plex_api_client-0.31.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-13 00:04:33",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "LukeHagar",
    "github_project": "plexpy",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "plex-api-client"
}
        
Elapsed time: 3.99345s