### Get Naming Configuration Examples Source: https://github.com/devopsarr/sonarr-py/blob/main/docs/NamingConfigApi.md Retrieves examples of naming configurations. ```APIDOC ## GET /api/v3/config/naming/examples ### Description Retrieves examples of naming configurations. ### Method GET ### Endpoint /api/v3/config/naming/examples ### Parameters This endpoint does not need any parameters. ### Response #### Success Response (200) - **NamingConfigResource** (object) - An example naming configuration resource. ### Response Example ```json { "id": 0, "renameExisting": true, "includeSeasonNumber": true, "includeEpisodeNumber": true, "standardEpisodeFormat": "{Series.Title} - S{season:02}E{episode:02} - {Episode.Title}", "dailyEpisodeFormat": "{Series.Title} - {Air-Date} - {Episode.Title}", "absoluteEpisodeFormat": "{Series.Title} - {absolute:000} - {Episode.Title}", "episodeDataBaseName": "{Series.Title} - S{season:02}E{episode:02} - {Episode.Title}", "multiEpisodeStyle": "{Series.Title} - S{season:02}E{episode:02}-{Episode.EpisodeCount:02} - {Episode.Title}", "multiEpisodexStyle": "{Series.Title} - S{season:02}E{episode:02}x{episode:02} - {Episode.Title}", "shortMultiEpisodeStyle": "{Series.Title} - S{season:02}E{episode:02}-{Episode.EpisodeCount:02} - {Episode.Title}", "shortMultiEpisodexStyle": "{Series.Title} - S{season:02}E{episode:02}x{episode:02} - {Episode.Title}", "specialsFormat": "{Series.Title} - S00E{episode:02} - {Episode.Title}", "useEmbeddedEpisodeNumber": false, "useEmbeddedEpisodeTitle": false, "applyLexicon": false, "applySceneNumber": false, "useSceneEpisodeNumber": false, "sceneSeparator": ".", "replaceSpaces": true, "spaceReplacementchyn": ".", "colonReplacementchyn": " - " } ``` ``` -------------------------------- ### Get Naming Config Examples Source: https://github.com/devopsarr/sonarr-py/blob/main/docs/NamingConfigApi.md Retrieves examples of naming configurations based on provided parameters. This endpoint is useful for testing and understanding how different naming formats are applied. ```APIDOC ## GET /api/v3/namingconfig/examples ### Description Retrieves examples of naming configurations. ### Method GET ### Endpoint /api/v3/namingconfig/examples ### Parameters #### Query Parameters - **renameEpisodes** (bool) - Optional - Indicates whether episode renaming is enabled. - **replaceIllegalCharacters** (bool) - Optional - Indicates whether illegal characters should be replaced. - **colonReplacementFormat** (int) - Optional - Specifies the format for replacing colons. - **customColonReplacementFormat** (str) - Optional - Defines a custom format for colon replacement. - **multiEpisodeStyle** (int) - Optional - Specifies the style for multi-episode formatting. - **standardEpisodeFormat** (str) - Optional - The format string for standard episodes. - **dailyEpisodeFormat** (str) - Optional - The format string for daily episodes. - **animeEpisodeFormat** (str) - Optional - The format string for anime episodes. - **seriesFolderFormat** (str) - Optional - The format string for series folders. - **seasonFolderFormat** (str) - Optional - The format string for season folders. - **specialsFolderFormat** (str) - Optional - The format string for specials folders. - **id** (int) - Optional - The ID of the naming configuration to use as a base. - **resourceName** (str) - Optional - The name of the resource to apply naming conventions to. ### Request Example ```python import sonarr from sonarr.rest import ApiException configuration = sonarr.Configuration( host = "http://localhost:8989" ) configuration.api_key['apikey'] = os.environ.get("API_KEY") with sonarr.ApiClient(configuration) as api_client: api_instance = sonarr.NamingConfigApi(api_client) try: api_instance.get_naming_config_examples(rename_episodes=True, replace_illegal_characters=True, colon_replacement_format=56, custom_colon_replacement_format='custom_colon_replacement_format_example', multi_episode_style=56, standard_episode_format='standard_episode_format_example', daily_episode_format='daily_episode_format_example', anime_episode_format='anime_episode_format_example', series_folder_format='series_folder_format_example', season_folder_format='season_folder_format_example', specials_folder_format='specials_folder_format_example', id=56, resource_name='resource_name_example') except ApiException as e: print(f"Exception when calling NamingConfigApi->get_naming_config_examples: {e}\n") ``` ### Response (empty response body) ``` -------------------------------- ### Get Naming Configuration Examples Source: https://github.com/devopsarr/sonarr-py/blob/main/docs/NamingConfigApi.md Use this endpoint to retrieve examples of naming configurations. It supports various optional parameters to customize the output, including episode renaming, illegal character replacement, and different formatting styles for series, seasons, and specials. Authentication is required via API key. ```python import sonarr from sonarr.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to http://localhost:8989 # See configuration.py for a list of all supported configuration parameters. configuration = sonarr.Configuration( host = "http://localhost:8989" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure API key authorization: apikey configuration.api_key['apikey'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['apikey'] = 'Bearer' # Configure API key authorization: X-Api-Key configuration.api_key['X-Api-Key'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['X-Api-Key'] = 'Bearer' # Enter a context with an instance of the API client with sonarr.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = sonarr.NamingConfigApi(api_client) rename_episodes = True # bool | (optional) replace_illegal_characters = True # bool | (optional) colon_replacement_format = 56 # int | (optional) custom_colon_replacement_format = 'custom_colon_replacement_format_example' # str | (optional) multi_episode_style = 56 # int | (optional) standard_episode_format = 'standard_episode_format_example' # str | (optional) daily_episode_format = 'daily_episode_format_example' # str | (optional) anime_episode_format = 'anime_episode_format_example' # str | (optional) series_folder_format = 'series_folder_format_example' # str | (optional) season_folder_format = 'season_folder_format_example' # str | (optional) specials_folder_format = 'specials_folder_format_example' # str | (optional) id = 56 # int | (optional) resource_name = 'resource_name_example' # str | (optional) try: api_instance.get_naming_config_examples(rename_episodes=rename_episodes, replace_illegal_characters=replace_illegal_characters, colon_replacement_format=colon_replacement_format, custom_colon_replacement_format=custom_colon_replacement_format, multi_episode_style=multi_episode_style, standard_episode_format=standard_episode_format, daily_episode_format=daily_episode_format, anime_episode_format=anime_episode_format, series_folder_format=series_folder_format, season_folder_format=season_folder_format, specials_folder_format=specials_folder_format, id=id, resource_name=resource_name) except Exception as e: print("Exception when calling NamingConfigApi->get_naming_config_examples: %s\n" % e) ``` -------------------------------- ### Install sonarr-py via Setuptools Source: https://github.com/devopsarr/sonarr-py/blob/main/README.md Alternatively, install the sonarr-py package using Setuptools. This method is useful if you are working with the source code directly. You can install for the current user or system-wide. ```sh python setup.py install --user ``` -------------------------------- ### Configure and Use Sonarr API Client Source: https://github.com/devopsarr/sonarr-py/blob/main/README.md Example demonstrating how to configure the Sonarr API client, set authentication (API key), and make a basic API call to get API information. Ensure your API key is set as an environment variable 'API_KEY'. ```python import sonarr from sonarr.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to http://localhost:8989 # See configuration.py for a list of all supported configuration parameters. configuration = sonarr.Configuration( host = "http://localhost:8989" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure API key authorization: apikey configuration.api_key['apikey'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['apikey'] = 'Bearer' # Configure API key authorization: X-Api-Key configuration.api_key['X-Api-Key'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['X-Api-Key'] = 'Bearer' # Enter a context with an instance of the API client with sonarr.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = sonarr.ApiInfoApi(api_client) try: api_instance.get_api() except ApiException as e: print("Exception when calling ApiInfoApi->get_api: %s\n" % e) ``` -------------------------------- ### Get Quality Definition Limits using Python Source: https://github.com/devopsarr/sonarr-py/blob/main/docs/QualityDefinitionApi.md Retrieves the quality definition limits. This example demonstrates setting up API key authentication and configuring the client host. The default host is http://localhost:8989. ```python import sonarr from sonarr.models.quality_definition_limits_resource import QualityDefinitionLimitsResource from sonarr.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to http://localhost:8989 # See configuration.py for a list of all supported configuration parameters. configuration = sonarr.Configuration( host = "http://localhost:8989" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure API key authorization: apikey configuration.api_key['apikey'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['apikey'] = 'Bearer' # Configure API key authorization: X-Api-Key configuration.api_key['X-Api-Key'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['X-Api-Key'] = 'Bearer' ``` -------------------------------- ### Retrieve Queue Information Source: https://github.com/devopsarr/sonarr-py/blob/main/docs/QueueApi.md This example demonstrates how to set up the Sonarr API client and configure authentication to retrieve queue information. It includes setup for API key authentication. ```python import sonarr from sonarr.models.download_protocol import DownloadProtocol from sonarr.models.queue_resource_paging_resource import QueueResourcePagingResource from sonarr.models.queue_status import QueueStatus from sonarr.models.sort_direction import SortDirection from sonarr.rest import ApiException from pprint import pprint configuration = sonarr.Configuration( host = "http://localhost:8989" ) configuration.api_key['apikey'] = os.environ["API_KEY"] configuration.api_key['X-Api-Key'] = os.environ["API_KEY"] ``` -------------------------------- ### Command Model Usage Example Source: https://github.com/devopsarr/sonarr-py/blob/main/docs/Command.md Example demonstrating how to create and manipulate Command objects using the Sonarr Python library, including instantiation from JSON and conversion to dictionaries. ```APIDOC ## Command Model Example ```python from sonarr.models.command import Command # TODO update the JSON string below json_string = "{}" # create an instance of Command from a JSON string command_instance = Command.from_json(json_string) # print the JSON string representation of the object print(Command.to_json()) # convert the object into a dict command_dict = command_instance.to_dict() # create an instance of Command from a dict command_from_dict = Command.from_dict(command_dict) ``` ``` -------------------------------- ### QualityDefinitionResource Example Usage Source: https://github.com/devopsarr/sonarr-py/blob/main/docs/QualityDefinitionResource.md Example of how to create and manipulate QualityDefinitionResource objects using the sonarr-py library. ```python from sonarr.models.quality_definition_resource import QualityDefinitionResource # TODO update the JSON string below json_string = "{}" # Create an instance of QualityDefinitionResource from a JSON string quality_definition_resource_instance = QualityDefinitionResource.from_json(json_string) # Print the JSON string representation of the object print(QualityDefinitionResource.to_json()) # Convert the object into a dict quality_definition_resource_dict = quality_definition_resource_instance.to_dict() # Create an instance of QualityDefinitionResource from a dict quality_definition_resource_from_dict = QualityDefinitionResource.from_dict(quality_definition_resource_dict) ``` -------------------------------- ### Get All Download Client Configurations Source: https://github.com/devopsarr/sonarr-py/blob/main/docs/DownloadClientConfigApi.md Retrieves a list of all configured download clients. ```APIDOC ## GET /api/v3/config/downloadclient ### Description Retrieves a list of all configured download clients. ### Method GET ### Endpoint /api/v3/config/downloadclient ### Parameters This endpoint does not need any parameters. ### Return type [DownloadClientConfigResource](DownloadClientConfigResource.md) ### Authorization [apikey](../README.md#apikey), [X-Api-Key](../README.md#X-Api-Key) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ### Response #### Success Response (200) - **list** (array) - A list of download client configurations. ### Request Example ```python import sonarr from sonarr.models.download_client_config_resource import DownloadClientConfigResource from sonarr.rest import ApiException from pprint import pprint configuration = sonarr.Configuration( host = "http://localhost:8989" ) configuration.api_key['apikey'] = os.environ["API_KEY"] configuration.api_key['X-Api-Key'] = os.environ["API_KEY"] with sonarr.ApiClient(configuration) as api_client: api_instance = sonarr.DownloadClientConfigApi(api_client) try: api_response = api_instance.get_download_client_config() pprint(api_response) except Exception as e: print("Exception when calling DownloadClientConfigApi->get_download_client_config: %s\n" % e) ``` ``` -------------------------------- ### Instantiate MediaManagementConfigResource from JSON and Dictionary Source: https://github.com/devopsarr/sonarr-py/blob/main/docs/MediaManagementConfigResource.md Demonstrates how to create an instance of MediaManagementConfigResource from a JSON string or a Python dictionary. Also shows how to convert the object back to a dictionary and its JSON string representation. ```python from sonarr.models.media_management_config_resource import MediaManagementConfigResource # TODO update the JSON string below json = "{}" # create an instance of MediaManagementConfigResource from a JSON string media_management_config_resource_instance = MediaManagementConfigResource.from_json(json) # print the JSON string representation of the object print(MediaManagementConfigResource.to_json()) # convert the object into a dict media_management_config_resource_dict = media_management_config_resource_instance.to_dict() # create an instance of MediaManagementConfigResource from a dict media_management_config_resource_from_dict = MediaManagementConfigResource.from_dict(media_management_config_resource_dict) ``` -------------------------------- ### Import sonarr-py package Source: https://github.com/devopsarr/sonarr-py/blob/main/README.md After installation, import the sonarr package into your Python script to start using its functionalities. ```python import sonarr ``` -------------------------------- ### Instantiate DownloadClientConfigResource from JSON and Dict Source: https://github.com/devopsarr/sonarr-py/blob/main/docs/DownloadClientConfigResource.md Demonstrates how to create a DownloadClientConfigResource object from a JSON string or a Python dictionary. It also shows how to convert the object back to a dictionary and print its JSON representation. ```python from sonarr.models.download_client_config_resource import DownloadClientConfigResource # TODO update the JSON string below json = "{}" # create an instance of DownloadClientConfigResource from a JSON string download_client_config_resource_instance = DownloadClientConfigResource.from_json(json) # print the JSON string representation of the object print(DownloadClientConfigResource.to_json()) # convert the object into a dict download_client_config_resource_dict = download_client_config_resource_instance.to_dict() # create an instance of DownloadClientConfigResource from a dict download_client_config_resource_from_dict = DownloadClientConfigResource.from_dict(download_client_config_resource_dict) ``` -------------------------------- ### Command Model Usage Source: https://github.com/devopsarr/sonarr-py/blob/main/docs/Command.md Demonstrates how to create a Command instance from a JSON string and convert it to a dictionary. Also shows how to create an instance from a dictionary and print its JSON representation. ```python from sonarr.models.command import Command # TODO update the JSON string below json = "{}" # create an instance of Command from a JSON string command_instance = Command.from_json(json) # print the JSON string representation of the object print(Command.to_json()) # convert the object into a dict command_dict = command_instance.to_dict() # create an instance of Command from a dict command_from_dict = Command.from_dict(command_dict) ``` -------------------------------- ### Get File System Type Source: https://github.com/devopsarr/sonarr-py/blob/main/docs/FileSystemApi.md Retrieves the file system type for a given path. Requires API key authentication. Ensure the 'sonarr' library is installed and configured with your Sonarr instance's host and API key. ```python import sonarr from sonarr.rest import ApiException from pprint import pprint import os # Defining the host is optional and defaults to http://localhost:8989 # See configuration.py for a list of all supported configuration parameters. configuration = sonarr.Configuration( host = "http://localhost:8989" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure API key authorization: apikey configuration.api_key['apikey'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['apikey'] = 'Bearer' # Configure API key authorization: X-Api-Key configuration.api_key['X-Api-Key'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['X-Api-Key'] = 'Bearer' # Enter a context with an instance of the API client with sonarr.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = sonarr.FileSystemApi(api_client) path = 'path_example' # str | (optional) try: api_instance.get_file_system_type(path=path) except Exception as e: print("Exception when calling FileSystemApi->get_file_system_type: %s\n" % e) ``` -------------------------------- ### Get Sonarr Logs Source: https://github.com/devopsarr/sonarr-py/blob/main/docs/LogApi.md Demonstrates how to retrieve log entries from Sonarr using the get_log method. Includes setup for API key authentication and handling the API response. Ensure your API key is set in the environment variable 'API_KEY'. ```python import sonarr from sonarr.models.log_resource_paging_resource import LogResourcePagingResource from sonarr.models.sort_direction import SortDirection from sonarr.rest import ApiException from pprint import pprint import os # Defining the host is optional and defaults to http://localhost:8989 # See configuration.py for a list of all supported configuration parameters. configuration = sonarr.Configuration( host = "http://localhost:8989" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure API key authorization: apikey configuration.api_key['apikey'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['apikey'] = 'Bearer' # Configure API key authorization: X-Api-Key configuration.api_key['X-Api-Key'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['X-Api-Key'] = 'Bearer' # Enter a context with an instance of the API client with sonarr.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = sonarr.LogApi(api_client) page = 1 # int | (optional) (default to 1) page_size = 10 # int | (optional) (default to 10) sort_key = 'sort_key_example' # str | (optional) sort_direction = sonarr.SortDirection() # SortDirection | (optional) level = 'level_example' # str | (optional) try: api_response = api_instance.get_log(page=page, page_size=page_size, sort_key=sort_key, sort_direction=sort_direction, level=level) print("The response of LogApi->get_log:\n") pprint(api_response) except Exception as e: print("Exception when calling LogApi->get_log: %s\n" % e) ``` -------------------------------- ### Instantiate QualityProfileResource from JSON and Dict Source: https://github.com/devopsarr/sonarr-py/blob/main/docs/QualityProfileResource.md Demonstrates creating a QualityProfileResource instance from a JSON string and a dictionary. Also shows how to convert the object back to JSON and a dictionary. ```python from sonarr.models.quality_profile_resource import QualityProfileResource # TODO update the JSON string below json = "{}" # create an instance of QualityProfileResource from a JSON string quality_profile_resource_instance = QualityProfileResource.from_json(json) # print the JSON string representation of the object print(QualityProfileResource.to_json()) # convert the object into a dict quality_profile_resource_dict = quality_profile_resource_instance.to_dict() # create an instance of QualityProfileResource from a dict quality_profile_resource_from_dict = QualityProfileResource.from_dict(quality_profile_resource_dict) ``` -------------------------------- ### Update Metadata Resource - Python Source: https://github.com/devopsarr/sonarr-py/blob/main/docs/MetadataApi.md This example demonstrates how to update a metadata resource in Sonarr. It shows the setup for API client configuration, including API key authentication, and how to make the update call with optional parameters like `force_save` and `metadata_resource`. ```python import sonarr from sonarr.models.metadata_resource import MetadataResource from sonarr.rest import ApiException from pprint import pprint import os # Defining the host is optional and defaults to http://localhost:8989 # See configuration.py for a list of all supported configuration parameters. configuration = sonarr.Configuration( host = "http://localhost:8989" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure API key authorization: apikey configuration.api_key['apikey'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['apikey'] = 'Bearer' # Configure API key authorization: X-Api-Key configuration.api_key['X-Api-Key'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['X-Api-Key'] = 'Bearer' # Enter a context with an instance of the API client with sonarr.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = sonarr.MetadataApi(api_client) id = 56 # int | force_save = False # bool | (optional) (default to False) metadata_resource = sonarr.MetadataResource() # MetadataResource | (optional) try: api_response = api_instance.update_metadata(id, force_save=force_save, metadata_resource=metadata_resource) print("The response of MetadataApi->update_metadata:\n") pprint(api_response) except Exception as e: print("Exception when calling MetadataApi->update_metadata: %s\n" % e) ``` -------------------------------- ### System API: Get System Routes (apikey) Source: https://github.com/devopsarr/sonarr-py/blob/main/docs/SystemApi.md Demonstrates how to authenticate with an API key and call the get_system_routes endpoint. Ensure the API_KEY environment variable is set. ```python import sonarr from sonarr.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to http://localhost:8989 # See configuration.py for a list of all supported configuration parameters. configuration = sonarr.Configuration( host = "http://localhost:8989" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure API key authorization: apikey configuration.api_key['apikey'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['apikey'] = 'Bearer' # Configure API key authorization: X-Api-Key configuration.api_key['X-Api-Key'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['X-Api-Key'] = 'Bearer' # Enter a context with an instance of the API client with sonarr.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = sonarr.SystemApi(api_client) try: api_instance.get_system_routes() except Exception as e: print("Exception when calling SystemApi->get_system_routes: %s\n" % e) ``` -------------------------------- ### Get Quality Profile Schema using Python Source: https://github.com/devopsarr/sonarr-py/blob/main/docs/QualityProfileSchemaApi.md Use this Python snippet to retrieve the quality profile schema from Sonarr. It shows how to configure the API client, handle authentication (API Key), and make the request. Ensure you have the 'sonarr' library installed and your API key set as an environment variable. ```python import sonarr from sonarr.models.quality_profile_resource import QualityProfileResource from sonarr.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to http://localhost:8989 # See configuration.py for a list of all supported configuration parameters. configuration = sonarr.Configuration( host = "http://localhost:8989" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure API key authorization: apikey configuration.api_key['apikey'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['apikey'] = 'Bearer' # Configure API key authorization: X-Api-Key configuration.api_key['X-Api-Key'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['X-Api-Key'] = 'Bearer' # Enter a context with an instance of the API client with sonarr.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = sonarr.QualityProfileSchemaApi(api_client) try: api_response = api_instance.get_qualityprofile_schema() print("The response of QualityProfileSchemaApi->get_qualityprofile_schema:\n") pprint(api_response) except Exception as e: print("Exception when calling QualityProfileSchemaApi->get_qualityprofile_schema: %s\n" % e) ``` -------------------------------- ### Instantiate QualityDefinitionLimitsResource from JSON and Dict Source: https://github.com/devopsarr/sonarr-py/blob/main/docs/QualityDefinitionLimitsResource.md Demonstrates how to create an instance of QualityDefinitionLimitsResource from a JSON string or a dictionary. It also shows how to convert the object back to a dictionary and print its JSON representation. ```python from sonarr.models.quality_definition_limits_resource import QualityDefinitionLimitsResource # TODO update the JSON string below json = "{}" # create an instance of QualityDefinitionLimitsResource from a JSON string quality_definition_limits_resource_instance = QualityDefinitionLimitsResource.from_json(json) # print the JSON string representation of the object print(QualityDefinitionLimitsResource.to_json()) # convert the object into a dict quality_definition_limits_resource_dict = quality_definition_limits_resource_instance.to_dict() # create an instance of QualityDefinitionLimitsResource from a dict quality_definition_limits_resource_from_dict = QualityDefinitionLimitsResource.from_dict(quality_definition_limits_resource_dict) ``` -------------------------------- ### Instantiate and Use ReleaseEpisodeResource Source: https://github.com/devopsarr/sonarr-py/blob/main/docs/ReleaseEpisodeResource.md Demonstrates how to create a ReleaseEpisodeResource instance from a JSON string or a dictionary, and how to convert it back to JSON or a dictionary. Ensure the JSON string is valid. ```python from sonarr.models.release_episode_resource import ReleaseEpisodeResource # TODO update the JSON string below json = "{}" # create an instance of ReleaseEpisodeResource from a JSON string release_episode_resource_instance = ReleaseEpisodeResource.from_json(json) # print the JSON string representation of the object print(ReleaseEpisodeResource.to_json()) # convert the object into a dict release_episode_resource_dict = release_episode_resource_instance.to_dict() # create an instance of ReleaseEpisodeResource from a dict release_episode_resource_from_dict = ReleaseEpisodeResource.from_dict(release_episode_resource_dict) ``` -------------------------------- ### Create Download Client - Python Source: https://github.com/devopsarr/sonarr-py/blob/main/docs/DownloadClientApi.md Use this method to create a new download client. Ensure API key authentication is configured correctly. The `download_client_resource` parameter is optional and defaults to an empty resource. ```python import sonarr from sonarr.models.download_client_resource import DownloadClientResource from sonarr.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to http://localhost:8989 # See configuration.py for a list of all supported configuration parameters. configuration = sonarr.Configuration( host = "http://localhost:8989" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure API key authorization: apikey configuration.api_key['apikey'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['apikey'] = 'Bearer' # Configure API key authorization: X-Api-Key configuration.api_key['X-Api-Key'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['X-Api-Key'] = 'Bearer' # Enter a context with an instance of the API client with sonarr.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = sonarr.DownloadClientApi(api_client) force_save = False # bool | (optional) (default to False) download_client_resource = sonarr.DownloadClientResource() # DownloadClientResource | (optional) try: api_response = api_instance.create_download_client(force_save=force_save, download_client_resource=download_client_resource) print("The response of DownloadClientApi->create_download_client:\n") pprint(api_response) except Exception as e: print("Exception when calling DownloadClientApi->create_download_client: %s\n" % e) ``` -------------------------------- ### Get API Info Source: https://github.com/devopsarr/sonarr-py/blob/main/README.md Retrieves information about the Sonarr API. This is a basic endpoint to verify API connectivity and get general information. ```APIDOC ## GET /api/v3/api ### Description Retrieves information about the Sonarr API. ### Method GET ### Endpoint /api/v3/api ### Parameters None ### Request Example None ### Response #### Success Response (200) - **data** (object) - Contains various details about the Sonarr API, such as version, build, and supported features. ### Response Example ```json { "version": "3.0.1.1537", "build": "3.0.1.1537", "startDate": "2023-01-01T10:00:00Z", " --- other api info ---" } ``` ``` -------------------------------- ### DownloadClientConfigResource Example Usage Source: https://github.com/devopsarr/sonarr-py/blob/main/docs/DownloadClientConfigResource.md Demonstrates how to use the DownloadClientConfigResource model in Python, including creating instances from JSON and dictionaries, and converting them back. ```APIDOC ## Example Usage ```python from sonarr.models.download_client_config_resource import DownloadClientConfigResource # TODO update the JSON string below json_string = "{}" # create an instance of DownloadClientConfigResource from a JSON string download_client_config_resource_instance = DownloadClientConfigResource.from_json(json_string) # print the JSON string representation of the object print(DownloadClientConfigResource.to_json()) # convert the object into a dict download_client_config_resource_dict = download_client_config_resource_instance.to_dict() # create an instance of DownloadClientConfigResource from a dict download_client_config_resource_from_dict = DownloadClientConfigResource.from_dict(download_client_config_resource_dict) ``` ``` -------------------------------- ### Create and Convert NamingConfigResource Instance Source: https://github.com/devopsarr/sonarr-py/blob/main/docs/NamingConfigResource.md Demonstrates how to create a NamingConfigResource instance from a JSON string, convert it to a dictionary, and then create a new instance from that dictionary. Ensure the JSON string is valid and properly formatted. ```python from sonarr.models.naming_config_resource import NamingConfigResource # TODO update the JSON string below json = "{}" # create an instance of NamingConfigResource from a JSON string naming_config_resource_instance = NamingConfigResource.from_json(json) # print the JSON string representation of the object print(NamingConfigResource.to_json()) # convert the object into a dict naming_config_resource_dict = naming_config_resource_instance.to_dict() # create an instance of NamingConfigResource from a dict naming_config_resource_from_dict = NamingConfigResource.from_dict(naming_config_resource_dict) ``` -------------------------------- ### Install sonarr-py via pip Source: https://github.com/devopsarr/sonarr-py/blob/main/README.md Install the sonarr-py package directly from its GitHub repository using pip. This is the recommended method for most users. You may need root permissions. ```sh pip install git+https://github.com/devopsarr/sonarr-py.git ``` -------------------------------- ### Instantiate and Convert QualityModel Source: https://github.com/devopsarr/sonarr-py/blob/main/docs/QualityModel.md Demonstrates creating a QualityModel instance from a JSON string, converting it to a dictionary, and then back to an instance from a dictionary. Ensure the JSON string is valid. ```python from sonarr.models.quality_model import QualityModel # TODO update the JSON string below json = "{}" # create an instance of QualityModel from a JSON string quality_model_instance = QualityModel.from_json(json) # print the JSON string representation of the object print(QualityModel.to_json()) # convert the object into a dict quality_model_dict = quality_model_instance.to_dict() # create an instance of QualityModel from a dict quality_model_from_dict = QualityModel.from_dict(quality_model_dict) ``` -------------------------------- ### Get API Information using ApiInfoApi Source: https://github.com/devopsarr/sonarr-py/blob/main/docs/ApiInfoApi.md Demonstrates how to instantiate and use the ApiInfoApi to call the get_api method. Includes configuration for host and API key authentication (apikey and X-Api-Key). ```python import sonarr from sonarr.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to http://localhost:8989 # See configuration.py for a list of all supported configuration parameters. configuration = sonarr.Configuration( host = "http://localhost:8989" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure API key authorization: apikey configuration.api_key['apikey'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['apikey'] = 'Bearer' # Configure API key authorization: X-Api-Key configuration.api_key['X-Api-Key'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['X-Api-Key'] = 'Bearer' # Enter a context with an instance of the API client with sonarr.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = sonarr.ApiInfoApi(api_client) try: api_instance.get_api() except Exception as e: print("Exception when calling ApiInfoApi->get_api: %s\n" % e) ``` -------------------------------- ### LogApi - Get Logs Source: https://github.com/devopsarr/sonarr-py/blob/main/README.md Retrieves system logs. ```APIDOC ## GET /api/v3/log ### Description Retrieves system logs. ### Method GET ### Endpoint /api/v3/log ``` -------------------------------- ### HostConfigResource Model Usage Source: https://github.com/devopsarr/sonarr-py/blob/main/docs/HostConfigResource.md Demonstrates how to create an instance of HostConfigResource from a JSON string and convert it to a dictionary. Also shows how to create an instance from a dictionary. ```python from sonarr.models.host_config_resource import HostConfigResource # TODO update the JSON string below json = "{}" # create an instance of HostConfigResource from a JSON string host_config_resource_instance = HostConfigResource.from_json(json) # print the JSON string representation of the object print(HostConfigResource.to_json()) # convert the object into a dict host_config_resource_dict = host_config_resource_instance.to_dict() # create an instance of HostConfigResource from a dict host_config_resource_from_dict = HostConfigResource.from_dict(host_config_resource_dict) ``` -------------------------------- ### LocalizationApi - Get Localization Source: https://github.com/devopsarr/sonarr-py/blob/main/README.md Retrieves localization strings. ```APIDOC ## GET /api/v3/localization ### Description Retrieves localization strings. ### Method GET ### Endpoint /api/v3/localization ``` -------------------------------- ### Get Blocklist Source: https://github.com/devopsarr/sonarr-py/blob/main/docs/BlocklistApi.md Retrieves the current blocklist entries. ```APIDOC ## GET /api/v3/blocklist ### Description Retrieves the current blocklist entries. ### Method GET ### Endpoint /api/v3/blocklist ### Authorization [apikey](../README.md#apikey), [X-Api-Key](../README.md#X-Api-Key) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: Not defined ``` -------------------------------- ### Create LocalizationResource from JSON and Dict Source: https://github.com/devopsarr/sonarr-py/blob/main/docs/LocalizationResource.md Demonstrates creating a LocalizationResource instance from a JSON string and a dictionary. Also shows how to convert the object back to a dictionary and print its JSON representation. ```python from sonarr.models.localization_resource import LocalizationResource # TODO update the JSON string below json = "{}" # create an instance of LocalizationResource from a JSON string localization_resource_instance = LocalizationResource.from_json(json) # print the JSON string representation of the object print(LocalizationResource.to_json()) # convert the object into a dict localization_resource_dict = localization_resource_instance.to_dict() # create an instance of LocalizationResource from a dict localization_resource_from_dict = LocalizationResource.from_dict(localization_resource_dict) ``` -------------------------------- ### Get Ping Status with Sonarr API Source: https://github.com/devopsarr/sonarr-py/blob/main/docs/PingApi.md Use this snippet to perform a GET request to the /ping endpoint to check the Sonarr API's status. It demonstrates setting up the API client, configuring authentication (API key), and handling the response or exceptions. ```python import sonarr from sonarr.models.ping_resource import PingResource from sonarr.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to http://localhost:8989 # See configuration.py for a list of all supported configuration parameters. configuration = sonarr.Configuration( host = "http://localhost:8989" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure API key authorization: apikey configuration.api_key['apikey'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['apikey'] = 'Bearer' # Configure API key authorization: X-Api-Key configuration.api_key['X-Api-Key'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['X-Api-Key'] = 'Bearer' # Enter a context with an instance of the API client with sonarr.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = sonarr.PingApi(api_client) try: api_response = api_instance.get_ping() print("The response of PingApi->get_ping:\n") pprint(api_response) except Exception as e: print("Exception when calling PingApi->get_ping: %s\n" % e) ``` -------------------------------- ### ImportListExclusionResourcePagingResource Example Source: https://github.com/devopsarr/sonarr-py/blob/main/docs/ImportListExclusionResourcePagingResource.md Demonstrates how to create an instance of ImportListExclusionResourcePagingResource from a JSON string and a dictionary. It also shows how to convert the object to a dictionary and print its JSON string representation. ```python from sonarr.models.import_list_exclusion_resource_paging_resource import ImportListExclusionResourcePagingResource # TODO update the JSON string below json = "{}" # create an instance of ImportListExclusionResourcePagingResource from a JSON string import_list_exclusion_resource_paging_resource_instance = ImportListExclusionResourcePagingResource.from_json(json) # print the JSON string representation of the object print(ImportListExclusionResourcePagingResource.to_json()) # convert the object into a dict import_list_exclusion_resource_paging_resource_dict = import_list_exclusion_resource_paging_resource_instance.to_dict() # create an instance of ImportListExclusionResourcePagingResource from a dict import_list_exclusion_resource_paging_resource_from_dict = ImportListExclusionResourcePagingResource.from_dict(import_list_exclusion_resource_paging_resource_dict) ``` -------------------------------- ### List Manual Imports using Python Source: https://github.com/devopsarr/sonarr-py/blob/main/docs/ManualImportApi.md This example demonstrates how to list manual imports from Sonarr. It includes configuration for API key authentication and shows how to set optional query parameters. ```python import sonarr from sonarr.models.manual_import_resource import ManualImportResource from sonarr.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to http://localhost:8989 # See configuration.py for a list of all supported configuration parameters. configuration = sonarr.Configuration( host = "http://localhost:8989" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure API key authorization: apikey configuration.api_key['apikey'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['apikey'] = 'Bearer' # Configure API key authorization: X-Api-Key configuration.api_key['X-Api-Key'] = os.environ["API_KEY"] # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['X-Api-Key'] = 'Bearer' ``` -------------------------------- ### LanguageApi - Get Language By ID Source: https://github.com/devopsarr/sonarr-py/blob/main/README.md Retrieves a specific language by its ID. ```APIDOC ## GET /api/v3/language/{id} ### Description Retrieves a specific language by its ID. ### Method GET ### Endpoint /api/v3/language/{id} #### Path Parameters - **id** (integer) - Required - The ID of the language to retrieve. ``` -------------------------------- ### Get UI Configuration Source: https://github.com/devopsarr/sonarr-py/blob/main/docs/UiConfigApi.md Retrieves the current UI configuration settings. ```APIDOC ## GET /api/v3/config/ui ### Description Retrieves the current UI configuration settings. ### Method GET ### Endpoint /api/v3/config/ui ### Parameters This endpoint does not need any parameters. ### Response #### Success Response (200) - **UiConfigResource** (object) - OK ### Authorization [apikey](../README.md#apikey), [X-Api-Key](../README.md#X-Api-Key) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ``` -------------------------------- ### Version Model Usage Source: https://github.com/devopsarr/sonarr-py/blob/main/docs/Version.md Demonstrates creating a Version instance from a JSON string, converting it to JSON, converting it to a dictionary, and creating an instance from a dictionary. Ensure the JSON string is valid. ```python from sonarr.models.version import Version # TODO update the JSON string below json = "{}" # create an instance of Version from a JSON string version_instance = Version.from_json(json) # print the JSON string representation of the object print Version.to_json() # convert the object into a dict version_dict = version_instance.to_dict() # create an instance of Version from a dict version_form_dict = version.from_dict(version_dict) ``` -------------------------------- ### Get Quality Definition Limits Source: https://github.com/devopsarr/sonarr-py/blob/main/docs/QualityDefinitionApi.md Retrieves the limits for quality definitions. ```APIDOC ## get_quality_definition_limits ### Description Retrieves the limits for quality definitions. ### Method GET ### Endpoint /api/v3/qualitydefinition/limits ### Parameters This endpoint does not need any parameter. ### Return type [**QualityDefinitionLimitsResource**](QualityDefinitionLimitsResource.md) ### Authorization [apikey](../README.md#apikey), [X-Api-Key](../README.md#X-Api-Key) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: text/plain, application/json, text/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| **2XX** | OK | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) ```