From 840bfd0dbb2358c5f624982f622feef340522342 Mon Sep 17 00:00:00 2001 From: ivanmilevtues Date: Mon, 9 Jun 2025 23:57:30 +0200 Subject: [PATCH] Added high-level diagrams --- .../API Configuration & Utilities.md | 116 +++++++++ .codeboarding/API Request Handling.md | 186 +++++++++++++++ .codeboarding/Old API Specific Endpoints.md | 106 +++++++++ .codeboarding/Twitch API Clients.md | 180 ++++++++++++++ .codeboarding/Twitch Data Models.md | 221 ++++++++++++++++++ .codeboarding/on_boarding.md | 167 +++++++++++++ 6 files changed, 976 insertions(+) create mode 100644 .codeboarding/API Configuration & Utilities.md create mode 100644 .codeboarding/API Request Handling.md create mode 100644 .codeboarding/Old API Specific Endpoints.md create mode 100644 .codeboarding/Twitch API Clients.md create mode 100644 .codeboarding/Twitch Data Models.md create mode 100644 .codeboarding/on_boarding.md diff --git a/.codeboarding/API Configuration & Utilities.md b/.codeboarding/API Configuration & Utilities.md new file mode 100644 index 0000000..6cea47d --- /dev/null +++ b/.codeboarding/API Configuration & Utilities.md @@ -0,0 +1,116 @@ +```mermaid +graph LR + Configuration_Management["Configuration Management"] + API_Exception_Handling["API Exception Handling"] + Authentication_Enforcement["Authentication Enforcement"] + Kraken_API_Interface["Kraken API Interface"] + Helix_API_Interface["Helix API Interface"] + Helix_API_Data_Handling["Helix API Data Handling"] + Resource_Object_Mapping["Resource Object Mapping"] + Kraken_API_Interface -- "initializes with" --> Configuration_Management + Kraken_API_Interface -- "invokes" --> API_Exception_Handling + Kraken_API_Interface -- "produces" --> Resource_Object_Mapping + Helix_API_Interface -- "initializes with" --> Configuration_Management + Helix_API_Interface -- "invokes" --> API_Exception_Handling + Helix_API_Interface -- "uses" --> Helix_API_Data_Handling + Helix_API_Data_Handling -- "invokes" --> API_Exception_Handling + Authentication_Enforcement -- "invokes" --> API_Exception_Handling + Authentication_Enforcement -- "enforces authentication for" --> Kraken_API_Interface + Authentication_Enforcement -- "enforces authentication for" --> Helix_API_Interface +``` +[![CodeBoarding](https://img.shields.io/badge/Generated%20by-CodeBoarding-9cf?style=flat-square)](https://github.com/CodeBoarding/GeneratedOnBoardings)[![Demo](https://img.shields.io/badge/Try%20our-Demo-blue?style=flat-square)](https://www.codeboarding.org/demo)[![Contact](https://img.shields.io/badge/Contact%20us%20-%20contact@codeboarding.org-lightgrey?style=flat-square)](mailto:contact@codeboarding.org) + +## Component Details + +This subsystem manages the loading and application of API configurations, handles various API-specific exceptions, and enforces authentication requirements for secure operations. It provides the foundational utilities for both Kraken and Helix API interfaces to function correctly and robustly. + +### Configuration Management +This component is responsible for loading and managing API credentials and settings, such as client IDs, client secrets, and backoff configurations, from various sources, primarily configuration files. It ensures that API clients are properly initialized with the necessary settings. + + +**Related Classes/Methods**: + +- `twitch.conf.credentials_from_config_file` (13:22) +- `twitch.conf.backoff_config` (25:34) +- `twitch.conf._get_config` (7:10) + + +### API Exception Handling +This component defines a hierarchy of custom exceptions specific to the Twitch API client. It provides specialized exception types for various error scenarios, including authentication failures, missing attributes, and general API-related issues, allowing for robust error management throughout the application. + + +**Related Classes/Methods**: + +- `twitch.exceptions.TwitchException` (1:2) +- `twitch.exceptions.TwitchAuthException` (5:6) +- `twitch.exceptions.TwitchAttributeException` (9:10) +- `twitch.exceptions.TwitchNotProvidedException` (13:14) +- `twitch.exceptions.TwitchOAuthException` (17:18) + + +### Authentication Enforcement +This component provides decorators to enforce authentication requirements for sensitive API operations. It ensures that methods requiring OAuth tokens or specific authentication are only executed when the necessary credentials are provided, raising appropriate exceptions otherwise. + + +**Related Classes/Methods**: + +- `twitch.decorators.oauth_required` (4:10) + + +### Kraken API Interface +Serves as the primary interface for interacting with the Twitch API v5 (Kraken), encapsulating various API categories like streams, users, and communities, and handling the underlying HTTP requests. + + +**Related Classes/Methods**: + +- `twitch.client.TwitchClient.__init__` (24:43) +- `twitch.api.base.TwitchAPI.__init__` (15:20) +- `twitch.api.base.TwitchAPI._request_get` (34:57) +- `twitch.api.collections.Collections.get_by_channel` (19:31) +- `twitch.api.streams.Streams.get_stream_by_user` (9:22) +- `twitch.api.users.Users.get_all_follows` (36:57) + + +### Helix API Interface +Provides the interface for accessing the Twitch Helix API, offering methods to retrieve modern Twitch data such as streams, games, and user information with advanced filtering. + + +**Related Classes/Methods**: + +- `twitch.helix.api.TwitchHelix.__init__` (32:41) +- `twitch.helix.api.TwitchHelix.get_oauth` (43:70) +- `twitch.helix.api.TwitchHelix.get_streams` (72:118) +- `twitch.helix.api.TwitchHelix.get_games` (120:136) +- `twitch.helix.api.TwitchHelix.get_clips` (138:187) +- `twitch.helix.api.TwitchHelix.get_top_games` (189:205) +- `twitch.helix.api.TwitchHelix.get_videos` (207:271) +- `twitch.helix.api.TwitchHelix.get_streams_metadata` (273:319) +- `twitch.helix.api.TwitchHelix.get_user_follows` (321:340) +- `twitch.helix.api.TwitchHelix.get_users` (342:358) +- `twitch.helix.api.TwitchHelix.get_tags` (360:376) + + +### Helix API Data Handling +Manages the specifics of data retrieval and pagination for the Helix API, including cursor-based navigation and general data fetching mechanisms. + + +**Related Classes/Methods**: + +- `twitch.helix.base.APICursor.total` (140:143) +- `twitch.helix.base.APICursor` (79:143) +- `twitch.helix.base.APIGet.fetch` (155:157) +- `twitch.helix.base.APIGet` (146:157) + + +### Resource Object Mapping +Converts raw JSON responses from the Twitch API into structured Python objects, providing an easy-to-use representation of Twitch resources for consumption by other components. + + +**Related Classes/Methods**: + +- `twitch.resources.TwitchObject.construct_from` (58:61) + + + + +### [FAQ](https://github.com/CodeBoarding/GeneratedOnBoardings/tree/main?tab=readme-ov-file#faq) \ No newline at end of file diff --git a/.codeboarding/API Request Handling.md b/.codeboarding/API Request Handling.md new file mode 100644 index 0000000..7a4ccc7 --- /dev/null +++ b/.codeboarding/API Request Handling.md @@ -0,0 +1,186 @@ +```mermaid +graph LR + Base_API_Client["Base API Client"] + Helix_Base_Request_Handler["Helix Base Request Handler"] + Paginated_API_Data_Handler["Paginated API Data Handler"] + Single_API_Data_Fetcher["Single API Data Fetcher"] + Helix_API_Client["Helix API Client"] + Twitch_API_Endpoints["Twitch API Endpoints"] + Twitch_Data_Models["Twitch Data Models"] + Twitch_Exceptions["Twitch Exceptions"] + Twitch_Samples["Twitch Samples"] + Helix_Base_Request_Handler -- "inherits from" --> Base_API_Client + Helix_API_Client -- "uses" --> Helix_Base_Request_Handler + Paginated_API_Data_Handler -- "uses" --> Helix_Base_Request_Handler + Single_API_Data_Fetcher -- "uses" --> Helix_Base_Request_Handler + Helix_API_Client -- "creates/uses" --> Paginated_API_Data_Handler + Helix_API_Client -- "creates/uses" --> Single_API_Data_Fetcher + Twitch_API_Endpoints -- "makes requests through" --> Base_API_Client + Twitch_API_Endpoints -- "constructs" --> Twitch_Data_Models + Paginated_API_Data_Handler -- "constructs" --> Twitch_Data_Models + Single_API_Data_Fetcher -- "constructs" --> Twitch_Data_Models + Helix_API_Client -- "raises" --> Twitch_Exceptions + Paginated_API_Data_Handler -- "raises" --> Twitch_Exceptions + Single_API_Data_Fetcher -- "raises" --> Twitch_Exceptions + Twitch_API_Endpoints -- "raises" --> Twitch_Exceptions + Twitch_Samples -- "demonstrates usage of" --> Helix_API_Client + Twitch_Samples -- "demonstrates usage of" --> Paginated_API_Data_Handler +``` +[![CodeBoarding](https://img.shields.io/badge/Generated%20by-CodeBoarding-9cf?style=flat-square)](https://github.com/CodeBoarding/GeneratedOnBoardings)[![Demo](https://img.shields.io/badge/Try%20our-Demo-blue?style=flat-square)](https://www.codeboarding.org/demo)[![Contact](https://img.shields.io/badge/Contact%20us%20-%20contact@codeboarding.org-lightgrey?style=flat-square)](mailto:contact@codeboarding.org) + +## Component Details + +The API Request Handling subsystem is responsible for managing all HTTP communication with the Twitch API, encompassing both v5 and Helix endpoints. Its core purpose is to abstract the complexities of web requests, including setting appropriate headers, adhering to rate limits, and handling data pagination for efficient and compliant data retrieval. This subsystem ensures that the application can reliably interact with Twitch services to fetch various types of data. + +### Base API Client +This component provides the fundamental HTTP request methods (GET, POST, PUT, DELETE) for interacting with the Twitch API (v5). It handles common functionalities like setting request headers, managing client ID and OAuth tokens, and implementing a basic backoff mechanism for server errors. + + +**Related Classes/Methods**: + +- `twitch.api.base.TwitchAPI` (12:95) +- `twitch.api.base.TwitchAPI:__init__` (15:20) +- `twitch.api.base.TwitchAPI:_get_request_headers` (22:32) +- `twitch.api.base.TwitchAPI:_request_get` (34:57) +- `twitch.api.base.TwitchAPI:_request_post` (59:70) +- `twitch.api.base.TwitchAPI:_request_put` (72:82) +- `twitch.api.base.TwitchAPI:_request_delete` (84:95) + + +### Helix Base Request Handler +This mixin provides common request handling functionalities specifically for the Twitch Helix API. It includes methods for preparing request headers and managing Twitch's rate limits to ensure compliant and efficient API calls. It extends the basic request handling from Base API Client. + + +**Related Classes/Methods**: + +- `twitch.helix.base.TwitchAPIMixin` (14:76) +- `twitch.helix.base.TwitchAPIMixin:_wait_for_rate_limit_reset` (18:38) +- `twitch.helix.base.TwitchAPIMixin:_get_request_headers` (40:46) +- `twitch.helix.base.TwitchAPIMixin:_request_get` (48:76) + + +### Paginated API Data Handler +This component is responsible for handling paginated responses from the Twitch Helix API. It allows for efficient retrieval of large datasets by managing cursors and fetching subsequent pages as needed, providing an iterable interface for results. + + +**Related Classes/Methods**: + +- `twitch.helix.base.APICursor` (79:143) +- `twitch.helix.base.APICursor:__init__` (80:95) +- `twitch.helix.base.APICursor:next_page` (118:133) +- `twitch.helix.base.APICursor:total` (140:143) + + +### Single API Data Fetcher +This component is designed for fetching single-page data from the Twitch Helix API. It provides a straightforward method to retrieve non-paginated API responses and process them into structured data models. + + +**Related Classes/Methods**: + +- `twitch.helix.base.APIGet` (146:157) +- `twitch.helix.base.APIGet:fetch` (155:157) + + +### Helix API Client +This component serves as the primary interface for interacting with the Twitch Helix API. It encapsulates various high-level methods for fetching data related to streams, games, clips, videos, and users, leveraging the underlying API request handlers. + + +**Related Classes/Methods**: + +- `twitch.helix.api.TwitchHelix` (27:376) +- `twitch.helix.api.TwitchHelix:get_games` (120:136) +- `twitch.helix.api.TwitchHelix:get_clips` (138:187) +- `twitch.helix.api.TwitchHelix:get_videos` (207:271) +- `twitch.helix.api.TwitchHelix:get_users` (342:358) +- `twitch.helix.api.TwitchHelix:get_streams` (72:118) +- `twitch.helix.api.TwitchHelix:get_top_games` (189:205) +- `twitch.helix.api.TwitchHelix:get_streams_metadata` (273:319) +- `twitch.helix.api.TwitchHelix:get_user_follows` (321:340) +- `twitch.helix.api.TwitchHelix:get_tags` (360:376) +- `twitch.helix.api.TwitchHelix:get_oauth` (43:70) + + +### Twitch API Endpoints +This group of components represents various specific functionalities and categories within the Twitch API (e.g., Collections, Streams, Users). Each component provides methods tailored to its domain, utilizing the Base API Client for underlying HTTP communication and Twitch Data Models for response parsing. + + +**Related Classes/Methods**: + +- `twitch.api.collections.Collections` (7:78) +- `twitch.api.streams.Streams` (8:83) +- `twitch.api.users.Users` (14:130) +- `twitch.api.chat.Chat` (4:18) +- `twitch.api.communities.Communities` (7:136) +- `twitch.api.channel_feed.ChannelFeed` (7:105) +- `twitch.api.teams.Teams` (6:19) +- `twitch.api.videos.Videos` (14:88) +- `twitch.api.games.Games` (6:15) +- `twitch.api.channels.Channels` (16:156) +- `twitch.api.clips.Clips` (8:56) +- `twitch.api.ingests.Ingests` (5:8) +- `twitch.api.search.Search` (6:33) + + +### Twitch Data Models +This component defines the structure and methods for converting raw API responses into Python objects. It includes a base class for dynamic attribute access and specific classes for various Twitch resources like channels, clips, games, and users. + + +**Related Classes/Methods**: + +- `twitch.resources.TwitchObject` (37:65) +- `twitch.resources.TwitchObject.construct_from` (58:61) +- `twitch.resources.TwitchObject.refresh_from` (63:65) +- `twitch.resources.convert_to_twitch_object` (4:34) +- `twitch.resources.Channel` (81:82) +- `twitch.resources.Clip` (85:86) +- `twitch.resources.Collection` (89:90) +- `twitch.resources.Comment` (93:94) +- `twitch.resources.Community` (97:98) +- `twitch.resources.Featured` (101:102) +- `twitch.resources.Follow` (105:106) +- `twitch.resources.Game` (109:110) +- `twitch.resources.Ingest` (113:114) +- `twitch.resources.Item` (117:118) +- `twitch.resources.Post` (121:122) +- `twitch.resources.Stream` (125:126) +- `twitch.resources.StreamMetadata` (129:130) +- `twitch.resources.Subscription` (133:134) +- `twitch.resources.Tag` (137:138) +- `twitch.resources.Team` (141:142) +- `twitch.resources.TopGame` (145:146) +- `twitch.resources.User` (149:150) +- `twitch.resources.UserBlock` (153:154) +- `twitch.resources.Video` (157:158) + + +### Twitch Exceptions +This component defines custom exception classes used throughout the library to signal specific error conditions encountered during API interactions, such as authentication failures, invalid attributes, or missing data. + + +**Related Classes/Methods**: + +- `twitch.exceptions` (full file reference) +- `twitch.exceptions.TwitchException` (1:2) +- `twitch.exceptions.TwitchAuthException` (5:6) +- `twitch.exceptions.TwitchAttributeException` (9:10) +- `twitch.exceptions.TwitchNotProvidedException` (13:14) +- `twitch.exceptions.TwitchOAuthException` (17:18) + + +### Twitch Samples +This component provides example usage of the Twitch API client, specifically demonstrating how to interact with the Helix API for common tasks like retrieving clips, games, streams, videos, and user follows. + + +**Related Classes/Methods**: + +- `samples.helix` (full file reference) +- `samples.helix:clips` (6:9) +- `samples.helix:games` (12:15) +- `samples.helix:streams` (18:21) +- `samples.helix:videos` (38:42) +- `samples.helix:user_follows` (52:57) + + + + +### [FAQ](https://github.com/CodeBoarding/GeneratedOnBoardings/tree/main?tab=readme-ov-file#faq) \ No newline at end of file diff --git a/.codeboarding/Old API Specific Endpoints.md b/.codeboarding/Old API Specific Endpoints.md new file mode 100644 index 0000000..ea597e2 --- /dev/null +++ b/.codeboarding/Old API Specific Endpoints.md @@ -0,0 +1,106 @@ +```mermaid +graph LR + Old_API_Specific_Endpoints["Old API Specific Endpoints"] + Twitch_API_Client["Twitch API Client"] + Twitch_Resources["Twitch Resources"] + Twitch_Exceptions["Twitch Exceptions"] + Old_API_Specific_Endpoints -- "makes requests via" --> Twitch_API_Client + Old_API_Specific_Endpoints -- "parses responses into" --> Twitch_Resources + Old_API_Specific_Endpoints -- "raises" --> Twitch_Exceptions +``` +[![CodeBoarding](https://img.shields.io/badge/Generated%20by-CodeBoarding-9cf?style=flat-square)](https://github.com/CodeBoarding/GeneratedOnBoardings)[![Demo](https://img.shields.io/badge/Try%20our-Demo-blue?style=flat-square)](https://www.codeboarding.org/demo)[![Contact](https://img.shields.io/badge/Contact%20us%20-%20contact@codeboarding.org-lightgrey?style=flat-square)](mailto:contact@codeboarding.org) + +## Component Details + +This architecture overview describes the subsystem responsible for interacting with the older Twitch API (v5). It details how various specific API endpoints for channels, streams, users, and communities are encapsulated, leveraging a core API client for HTTP requests, structured data models for responses, and custom exception handling for robust error management. + +### Old API Specific Endpoints +Encapsulates the specific functionalities and methods for interacting with various categories of the older Twitch API (v5), such as channels, streams, users, and communities. + + +**Related Classes/Methods**: + +- `python-twitch-client.twitch.api.collections.Collections:get_metadata` (8:10) +- `python-twitch-client.twitch.api.collections.Collections:get` (12:17) +- `python-twitch-client.twitch.api.collections.Collections:get_by_channel` (19:31) +- `python-twitch-client.twitch.api.collections.Collections:create` (34:41) +- `python-twitch-client.twitch.api.collections.Collections:update` (44:48) +- `python-twitch-client.twitch.api.collections.Collections:create_thumbnail` (51:55) +- `python-twitch-client.twitch.api.collections.Collections:delete` (58:59) +- `python-twitch-client.twitch.api.collections.Collections:add_item` (62:67) +- `python-twitch-client.twitch.api.collections.Collections:delete_item` (70:72) +- `python-twitch-client.twitch.api.collections.Collections:move_item` (75:78) +- `python-twitch-client.twitch.api.streams.Streams` (8:83) +- `python-twitch-client.twitch.api.users.Users` (14:130) +- `python-twitch-client.twitch.api.chat.Chat` (4:18) +- `python-twitch-client.twitch.api.communities.Communities` (7:136) +- `python-twitch-client.twitch.api.channel_feed.ChannelFeed` (7:105) +- `python-twitch-client.twitch.api.teams.Teams` (6:19) +- `python-twitch-client.twitch.api.videos.Videos` (14:88) +- `python-twitch-client.twitch.api.games.Games` (6:15) +- `python-twitch-client.twitch.api.channels.Channels` (16:156) +- `python-twitch-client.twitch.api.clips.Clips` (8:56) +- `python-twitch-client.twitch.api.ingests.Ingests` (5:8) +- `python-twitch-client.twitch.api.search.Search` (6:33) + + +### Twitch API Client +This component is responsible for handling all HTTP requests to the Twitch API. It manages authentication headers, constructs URLs, and implements retry mechanisms for server-side errors to ensure robust communication with the Twitch service. + + +**Related Classes/Methods**: + +- `twitch.api.base.TwitchAPI` (12:95) +- `twitch.api.base.TwitchAPI._request_get` (34:57) +- `twitch.api.base.TwitchAPI._request_post` (59:70) +- `twitch.api.base.TwitchAPI._request_put` (72:82) +- `twitch.api.base.TwitchAPI._request_delete` (84:95) +- `twitch.api.base.TwitchAPI._get_request_headers` (22:32) +- `twitch.api.base.TwitchAPI:__init__` (15:20) + + +### Twitch Resources +This component defines the data models for various Twitch API entities. It provides a base class and subclasses for parsing raw JSON responses into structured Python objects, facilitating easy access to API data and handling type conversions like timestamps. + + +**Related Classes/Methods**: + +- `twitch.resources.TwitchObject` (37:65) +- `twitch.resources.TwitchObject.construct_from` (58:61) +- `twitch.resources.TwitchObject.refresh_from` (63:65) +- `twitch.resources.Channel` (81:82) +- `twitch.resources.Clip` (85:86) +- `twitch.resources.Collection` (89:90) +- `twitch.resources.Comment` (93:94) +- `twitch.resources.Community` (97:98) +- `twitch.resources.Featured` (101:102) +- `twitch.resources.Follow` (105:106) +- `twitch.resources.Game` (109:110) +- `twitch.resources.Ingest` (113:114) +- `twitch.resources.Item` (117:118) +- `twitch.resources.Post` (121:122) +- `twitch.resources.Stream` (125:126) +- `twitch.resources.StreamMetadata` (129:130) +- `twitch.resources.Subscription` (133:134) +- `twitch.resources.Tag` (137:138) +- `twitch.resources.Team` (141:142) +- `twitch.resources.TopGame` (145:146) +- `twitch.resources.User` (149:150) +- `twitch.resources.UserBlock` (153:154) +- `twitch.resources.Video` (157:158) +- `twitch.resources._DateTime` (68:78) +- `twitch.resources.convert_to_twitch_object` (4:34) + + +### Twitch Exceptions +This component defines custom exception classes specifically for handling errors that may arise during interactions with the Twitch API. It provides a structured way to signal issues such as missing or invalid attributes in API requests or responses. + + +**Related Classes/Methods**: + +- `twitch.exceptions.TwitchAttributeException` (9:10) + + + + +### [FAQ](https://github.com/CodeBoarding/GeneratedOnBoardings/tree/main?tab=readme-ov-file#faq) \ No newline at end of file diff --git a/.codeboarding/Twitch API Clients.md b/.codeboarding/Twitch API Clients.md new file mode 100644 index 0000000..d603d91 --- /dev/null +++ b/.codeboarding/Twitch API Clients.md @@ -0,0 +1,180 @@ +```mermaid +graph LR + TwitchClient_Kraken_API_Wrapper_["TwitchClient (Kraken API Wrapper)"] + TwitchHelix_Helix_API_Wrapper_["TwitchHelix (Helix API Wrapper)"] + API_Request_Handling_Base_["API Request Handling (Base)"] + Configuration_Management["Configuration Management"] + Kraken_API_Categories["Kraken API Categories"] + Exception_Handling["Exception Handling"] + Twitch_Resource_Models["Twitch Resource Models"] + Shared_Constants["Shared Constants"] + API_Decorators["API Decorators"] + TwitchClient_Kraken_API_Wrapper_ -- "initializes with" --> Configuration_Management + TwitchClient_Kraken_API_Wrapper_ -- "instantiates" --> Kraken_API_Categories + TwitchClient_Kraken_API_Wrapper_ -- "uses" --> API_Request_Handling_Base_ + TwitchHelix_Helix_API_Wrapper_ -- "initializes with" --> Configuration_Management + TwitchHelix_Helix_API_Wrapper_ -- "uses" --> API_Request_Handling_Base_ + TwitchHelix_Helix_API_Wrapper_ -- "raises" --> Exception_Handling + TwitchHelix_Helix_API_Wrapper_ -- "returns" --> Twitch_Resource_Models + API_Request_Handling_Base_ -- "raises" --> Exception_Handling + API_Request_Handling_Base_ -- "uses" --> Shared_Constants + Kraken_API_Categories -- "uses" --> API_Request_Handling_Base_ + Kraken_API_Categories -- "raises" --> Exception_Handling + Kraken_API_Categories -- "returns" --> Twitch_Resource_Models + Configuration_Management -- "uses" --> Shared_Constants + API_Decorators -- "raises" --> Exception_Handling + Kraken_API_Categories -- "uses" --> API_Decorators +``` +[![CodeBoarding](https://img.shields.io/badge/Generated%20by-CodeBoarding-9cf?style=flat-square)](https://github.com/CodeBoarding/GeneratedOnBoardings)[![Demo](https://img.shields.io/badge/Try%20our-Demo-blue?style=flat-square)](https://www.codeboarding.org/demo)[![Contact](https://img.shields.io/badge/Contact%20us%20-%20contact@codeboarding.org-lightgrey?style=flat-square)](mailto:contact@codeboarding.org) + +## Component Details + +This graph describes the structure and interactions within the Twitch API Clients subsystem. It primarily focuses on how the system provides interfaces for both the older Twitch API (v5, Kraken) and the newer Twitch Helix API. The main flow involves client initialization, making API requests through dedicated handlers, processing responses into resource models, and managing authentication and error handling. The purpose is to offer a comprehensive and structured way to interact with various Twitch API functionalities. + +### TwitchClient (Kraken API Wrapper) +Serves as the primary interface for interacting with the Twitch API v5 (Kraken), providing methods to access various Twitch resources by instantiating and managing specific API category classes. It also handles the initial loading of credentials. + + +**Related Classes/Methods**: + +- `python-twitch-client.twitch.client.TwitchClient:__init__` (24:43) +- `python-twitch-client.twitch.client.TwitchClient:channel_feed` (46:51) +- `python-twitch-client.twitch.client.TwitchClient:clips` (54:59) +- `python-twitch-client.twitch.client.TwitchClient:channels` (62:67) +- `python-twitch-client.twitch.client.TwitchClient:chat` (70:73) +- `python-twitch-client.twitch.client.TwitchClient:collections` (76:81) +- `python-twitch-client.twitch.client.TwitchClient:communities` (84:89) +- `python-twitch-client.twitch.client.TwitchClient:games` (92:97) +- `python-twitch-client.twitch.client.TwitchClient:ingests` (100:105) +- `python-twitch-client.twitch.client.TwitchClient:search` (108:113) +- `python-twitch-client.twitch.client.TwitchClient:streams` (116:121) +- `python-twitch-client.twitch.client.TwitchClient:teams` (124:129) +- `python-twitch-client.twitch.client.TwitchClient:users` (132:137) +- `python-twitch-client.twitch.client.TwitchClient:videos` (140:145) + + +### TwitchHelix (Helix API Wrapper) +Provides the interface for interacting with the Twitch Helix API, including methods for retrieving various data types such as streams, games, clips, and users. It is responsible for handling OAuth authentication for Helix API calls. + + +**Related Classes/Methods**: + +- `python-twitch-client.twitch.helix.api.TwitchHelix:__init__` (32:41) +- `python-twitch-client.twitch.helix.api.TwitchHelix:get_oauth` (43:70) +- `python-twitch-client.twitch.helix.api.TwitchHelix:get_streams` (72:118) +- `python-twitch-client.twitch.helix.api.TwitchHelix:get_games` (120:136) +- `python-twitch-client.twitch.helix.api.TwitchHelix:get_clips` (138:187) +- `python-twitch-client.twitch.helix.api.TwitchHelix:get_top_games` (189:205) +- `python-twitch-client.twitch.helix.api.TwitchHelix:get_videos` (207:271) +- `python-twitch-client.twitch.helix.api.TwitchHelix:get_streams_metadata` (273:319) +- `python-twitch-client.twitch.helix.api.TwitchHelix:get_user_follows` (321:340) +- `python-twitch-client.twitch.helix.api.TwitchHelix:get_users` (342:358) +- `python-twitch-client.twitch.helix.api.TwitchHelix:get_tags` (360:376) + + +### API Request Handling (Base) +Encapsulates the core logic for making HTTP requests to the Twitch API for both Kraken and Helix versions. It manages rate limiting, constructs request headers, and handles the parsing of API responses. It includes classes for cursor-based pagination (APICursor) and single-fetch requests (APIGet) for Helix, and a base class for Kraken API interactions (TwitchAPI). + + +**Related Classes/Methods**: + +- `python-twitch-client.twitch.helix.base.APICursor` (79:143) +- `python-twitch-client.twitch.helix.base.APIGet` (146:157) +- `python-twitch-client.twitch.api.base.TwitchAPI` (12:95) +- `python-twitch-client.twitch.helix.base.TwitchAPIMixin` (14:76) + + +### Configuration Management +Responsible for reading and providing client credentials and other configuration settings, typically from a configuration file, to other parts of the system that require authentication or specific settings. + + +**Related Classes/Methods**: + +- `python-twitch-client.twitch.conf.credentials_from_config_file` (13:22) +- `python-twitch-client.twitch.conf` (full file reference) + + +### Kraken API Categories +A collection of classes, each dedicated to encapsulating specific functionalities and endpoints of the Twitch API v5 (Kraken). These classes provide methods for interacting with various Twitch resources such as channels, clips, chat, and user-related operations. + + +**Related Classes/Methods**: + +- `python-twitch-client.twitch.api.channel_feed.ChannelFeed` (7:105) +- `python-twitch-client.twitch.api.clips.Clips` (8:56) +- `python-twitch-client.twitch.api.channels.Channels` (16:156) +- `python-twitch-client.twitch.api.chat.Chat` (4:18) +- `python-twitch-client.twitch.api.collections.Collections` (7:78) +- `python-twitch-client.twitch.api.communities.Communities` (7:136) +- `python-twitch-client.twitch.api.games.Games` (6:15) +- `python-twitch-client.twitch.api.ingests.Ingests` (5:8) +- `python-twitch-client.twitch.api.search.Search` (6:33) +- `python-twitch-client.twitch.api.streams.Streams` (8:83) +- `python-twitch-client.twitch.api.teams.Teams` (6:19) +- `python-twitch-client.twitch.api.users.Users` (14:130) +- `python-twitch-client.twitch.api.videos.Videos` (14:88) + + +### Exception Handling +Defines a set of custom exception classes used throughout the `python-twitch-client` library. These exceptions are raised to signal specific error conditions, such as issues related to OAuth authentication, invalid attribute values, or missing required data. + + +**Related Classes/Methods**: + +- `python-twitch-client.twitch.exceptions.TwitchOAuthException` (17:18) +- `python-twitch-client.twitch.exceptions.TwitchAttributeException` (9:10) +- `python-twitch-client.twitch.exceptions.TwitchAuthException` (5:6) +- `python-twitch-client.twitch.exceptions.TwitchException` (1:2) +- `python-twitch-client.twitch.exceptions.TwitchNotProvidedException` (13:14) + + +### Twitch Resource Models +Provides data models representing various Twitch entities (e.g., Channel, Clip, Stream, User). These models are used to structure the data returned by both Kraken and Helix API calls. + + +**Related Classes/Methods**: + +- `python-twitch-client.twitch.resources.TwitchObject` (37:65) +- `python-twitch-client.twitch.resources.Channel` (81:82) +- `python-twitch-client.twitch.resources.Clip` (85:86) +- `python-twitch-client.twitch.resources.Collection` (89:90) +- `python-twitch-client.twitch.resources.Comment` (93:94) +- `python-twitch-client.twitch.resources.Community` (97:98) +- `python-twitch-client.twitch.resources.Featured` (101:102) +- `python-twitch-client.twitch.resources.Follow` (105:106) +- `python-twitch-client.twitch.resources.Game` (109:110) +- `python-twitch-client.twitch.resources.Ingest` (113:114) +- `python-twitch-client.twitch.resources.Item` (117:118) +- `python-twitch-client.twitch.resources.Post` (121:122) +- `python-twitch-client.twitch.resources.Stream` (125:126) +- `python-twitch-client.twitch.resources.StreamMetadata` (129:130) +- `python-twitch-client.twitch.resources.Subscription` (133:134) +- `python-twitch-client.twitch.resources.Tag` (137:138) +- `python-twitch-client.twitch.resources.Team` (141:142) +- `python-twitch-client.twitch.resources.TopGame` (145:146) +- `python-twitch-client.twitch.resources.User` (149:150) +- `python-twitch-client.twitch.resources.UserBlock` (153:154) +- `python-twitch-client.twitch.resources.Video` (157:158) + + +### Shared Constants +Contains various constant values used across different parts of the Twitch API client, such as API endpoints, default values, and other fixed parameters. + + +**Related Classes/Methods**: + +- `python-twitch-client.twitch.constants` (full file reference) + + +### API Decorators +Provides decorators used to modify the behavior of API methods, potentially for validation, error handling, or other cross-cutting concerns. + + +**Related Classes/Methods**: + +- `python-twitch-client.twitch.decorators` (full file reference) + + + + +### [FAQ](https://github.com/CodeBoarding/GeneratedOnBoardings/tree/main?tab=readme-ov-file#faq) \ No newline at end of file diff --git a/.codeboarding/Twitch Data Models.md b/.codeboarding/Twitch Data Models.md new file mode 100644 index 0000000..4c2fa10 --- /dev/null +++ b/.codeboarding/Twitch Data Models.md @@ -0,0 +1,221 @@ +```mermaid +graph LR + Twitch_Data_Models["Twitch Data Models"] + Twitch_API_Base["Twitch API Base"] + Collections_API["Collections API"] + Streams_API["Streams API"] + Users_API["Users API"] + Communities_API["Communities API"] + Channel_Feed_API["Channel Feed API"] + Channels_API["Channels API"] + Search_API["Search API"] + General_API_Endpoints["General API Endpoints"] + Twitch_Exceptions["Twitch Exceptions"] + Collections_API -- "makes requests through" --> Twitch_API_Base + Collections_API -- "converts responses to objects via" --> Twitch_Data_Models + Collections_API -- "may raise" --> Twitch_Exceptions + Streams_API -- "makes requests through" --> Twitch_API_Base + Streams_API -- "converts responses to objects via" --> Twitch_Data_Models + Streams_API -- "may raise" --> Twitch_Exceptions + Users_API -- "makes requests through" --> Twitch_API_Base + Users_API -- "converts responses to objects via" --> Twitch_Data_Models + Users_API -- "may raise" --> Twitch_Exceptions + Communities_API -- "makes requests through" --> Twitch_API_Base + Communities_API -- "converts responses to objects via" --> Twitch_Data_Models + Communities_API -- "may raise" --> Twitch_Exceptions + Channel_Feed_API -- "makes requests through" --> Twitch_API_Base + Channel_Feed_API -- "converts responses to objects via" --> Twitch_Data_Models + Channel_Feed_API -- "may raise" --> Twitch_Exceptions + Channels_API -- "makes requests through" --> Twitch_API_Base + Channels_API -- "converts responses to objects via" --> Twitch_Data_Models + Channels_API -- "may raise" --> Twitch_Exceptions + Search_API -- "makes requests through" --> Twitch_API_Base + Search_API -- "converts responses to objects via" --> Twitch_Data_Models + Search_API -- "may raise" --> Twitch_Exceptions + General_API_Endpoints -- "makes requests through" --> Twitch_API_Base + General_API_Endpoints -- "converts responses to objects via" --> Twitch_Data_Models + General_API_Endpoints -- "may raise" --> Twitch_Exceptions +``` +[![CodeBoarding](https://img.shields.io/badge/Generated%20by-CodeBoarding-9cf?style=flat-square)](https://github.com/CodeBoarding/GeneratedOnBoardings)[![Demo](https://img.shields.io/badge/Try%20our-Demo-blue?style=flat-square)](https://www.codeboarding.org/demo)[![Contact](https://img.shields.io/badge/Contact%20us%20-%20contact@codeboarding.org-lightgrey?style=flat-square)](mailto:contact@codeboarding.org) + +## Component Details + +This architecture defines the structure and interactions of components within a Twitch API client. It encompasses data models for representing Twitch resources, a base for API communication, and specialized API components for various Twitch functionalities like streams, users, channels, and communities. The core flow involves API components making requests through the base API, receiving raw responses, and converting them into structured data models. Error handling is centralized through a dedicated exceptions component. + +### Twitch Data Models +Defines the Python object structures for representing various Twitch API resources, facilitating the conversion of raw API responses into easily manipulable objects within the application. This component includes a base class for Twitch objects and specific classes for different Twitch entities like Channel, Clip, Stream, User, etc. + + +**Related Classes/Methods**: + +- `python-twitch-client.twitch.resources:convert_to_twitch_object` (4:34) +- `python-twitch-client.twitch.resources.TwitchObject:construct_from` (58:61) +- `python-twitch-client.twitch.resources.TwitchObject:refresh_from` (63:65) +- `python-twitch-client.twitch.resources.TwitchObject.__setitem__` (53:55) +- `python-twitch-client.twitch.resources.Channel` (81:82) +- `python-twitch-client.twitch.resources.Clip` (85:86) +- `python-twitch-client.twitch.resources.Collection` (89:90) +- `python-twitch-client.twitch.resources.Comment` (93:94) +- `python-twitch-client.twitch.resources.Community` (97:98) +- `python-twitch-client.twitch.resources.Featured` (101:102) +- `python-twitch-client.twitch.resources.Follow` (105:106) +- `python-twitch-client.twitch.resources.Game` (109:110) +- `python-twitch-client.twitch.resources.Ingest` (113:114) +- `python-twitch-client.twitch.resources.Item` (117:118) +- `python-twitch-client.twitch.resources.Post` (121:122) +- `python-twitch-client.twitch.resources.Stream` (125:126) +- `python-twitch-client.twitch.resources.StreamMetadata` (129:130) +- `python-twitch-client.twitch.resources.Subscription` (133:134) +- `python-twitch-client.twitch.resources.Tag` (137:138) +- `python-twitch-client.twitch.resources.Team` (141:142) +- `python-twitch-client.twitch.resources.TopGame` (145:146) +- `python-twitch-client.twitch.resources.User` (149:150) +- `python-twitch-client.twitch.resources.UserBlock` (153:154) +- `python-twitch-client.twitch.resources.Video` (157:158) + + +### Twitch API Base +This component provides the fundamental methods for interacting with the Twitch API, including making GET, POST, PUT, and DELETE requests. It serves as the base for all specific API endpoint implementations, abstracting the underlying HTTP communication details. + + +**Related Classes/Methods**: + +- `python-twitch-client.twitch.api.base.TwitchAPI._request_get` (34:57) +- `python-twitch-client.twitch.api.base.TwitchAPI._request_post` (59:70) +- `python-twitch-client.twitch.api.base.TwitchAPI._request_put` (72:82) +- `python-twitch-client.twitch.api.base.TwitchAPI._request_delete` (84:95) + + +### Collections API +This component provides methods for interacting with Twitch collections, allowing users to retrieve metadata, get collections, get collections by channel, create collections, and add items to collections. It acts as an interface for managing user-defined content groupings on Twitch. + + +**Related Classes/Methods**: + +- `python-twitch-client.twitch.api.collections.Collections:get_metadata` (8:10) +- `python-twitch-client.twitch.api.collections.Collections:get` (12:17) +- `python-twitch-client.twitch.api.collections.Collections:get_by_channel` (19:31) +- `python-twitch-client.twitch.api.collections.Collections:create` (34:41) +- `python-twitch-client.twitch.api.collections.Collections:add_item` (62:67) + + +### Streams API +This component handles interactions related to Twitch streams, including retrieving stream information by user, getting live streams, featured streams, followed streams, and streams within a community. It enables the client to access and manage real-time broadcast data. + + +**Related Classes/Methods**: + +- `python-twitch-client.twitch.api.streams.Streams:get_stream_by_user` (9:22) +- `python-twitch-client.twitch.api.streams.Streams:get_live_streams` (24:46) +- `python-twitch-client.twitch.api.streams.Streams:get_featured` (55:63) +- `python-twitch-client.twitch.api.streams.Streams:get_followed` (66:78) +- `python-twitch-client.twitch.api.streams.Streams:get_streams_in_community` (80:83) + + +### Users API +This component provides functionalities for managing and retrieving Twitch user information, such as getting user details, checking subscriptions, managing follows, and handling user blocks. It serves as the primary interface for user-centric operations. + + +**Related Classes/Methods**: + +- `python-twitch-client.twitch.api.users.Users:get` (16:18) +- `python-twitch-client.twitch.api.users.Users:get_by_id` (20:22) +- `python-twitch-client.twitch.api.users.Users:check_subscribed_to_channel` (30:34) +- `python-twitch-client.twitch.api.users.Users:get_all_follows` (36:57) +- `python-twitch-client.twitch.api.users.Users:get_follows` (59:83) +- `python-twitch-client.twitch.api.users.Users:check_follows_channel` (85:89) +- `python-twitch-client.twitch.api.users.Users:follow_channel` (92:97) +- `python-twitch-client.twitch.api.users.Users:get_user_block_list` (104:112) +- `python-twitch-client.twitch.api.users.Users:block_user` (115:119) +- `python-twitch-client.twitch.api.users.Users:translate_usernames_to_ids` (125:130) + + +### Communities API +This component allows interaction with Twitch communities, enabling retrieval of community details by name or ID, getting top communities, and managing banned or timed-out users and moderators within a community. It facilitates the management and exploration of Twitch's community features. + + +**Related Classes/Methods**: + +- `python-twitch-client.twitch.api.communities.Communities:get_by_name` (8:11) +- `python-twitch-client.twitch.api.communities.Communities:get_by_id` (13:15) +- `python-twitch-client.twitch.api.communities.Communities:get_top` (28:35) +- `python-twitch-client.twitch.api.communities.Communities:get_banned_users` (38:48) +- `python-twitch-client.twitch.api.communities.Communities:get_moderators` (84:86) +- `python-twitch-client.twitch.api.communities.Communities:get_timed_out_users` (113:122) + + +### Channel Feed API +This component manages operations related to Twitch channel feeds, including getting posts and comments, creating and deleting posts, and creating and deleting comments. It provides the means to interact with the social feed functionality of Twitch channels. + + +**Related Classes/Methods**: + +- `python-twitch-client.twitch.api.channel_feed.ChannelFeed:get_posts` (8:20) +- `python-twitch-client.twitch.api.channel_feed.ChannelFeed:get_post` (22:32) +- `python-twitch-client.twitch.api.channel_feed.ChannelFeed:create_post` (35:41) +- `python-twitch-client.twitch.api.channel_feed.ChannelFeed:delete_post` (44:46) +- `python-twitch-client.twitch.api.channel_feed.ChannelFeed:get_post_comments` (62:74) +- `python-twitch-client.twitch.api.channel_feed.ChannelFeed:create_post_comment` (77:81) +- `python-twitch-client.twitch.api.channel_feed.ChannelFeed:delete_post_comment` (84:87) + + +### Channels API +This component provides methods for interacting with Twitch channels, such as retrieving channel details, updating channel information, getting editors, followers, teams, and subscribers, checking subscriptions, getting videos, resetting stream keys, and getting community information. It offers comprehensive control over Twitch channel properties and associated data. + + +**Related Classes/Methods**: + +- `python-twitch-client.twitch.api.channels.Channels:get` (18:20) +- `python-twitch-client.twitch.api.channels.Channels:get_by_id` (22:24) +- `python-twitch-client.twitch.api.channels.Channels:update` (27:42) +- `python-twitch-client.twitch.api.channels.Channels:get_editors` (45:47) +- `python-twitch-client.twitch.api.channels.Channels:get_followers` (49:67) +- `python-twitch-client.twitch.api.channels.Channels:get_teams` (69:71) +- `python-twitch-client.twitch.api.channels.Channels:get_subscribers` (74:88) +- `python-twitch-client.twitch.api.channels.Channels:check_subscription_by_user` (90:94) +- `python-twitch-client.twitch.api.channels.Channels:get_videos` (96:133) +- `python-twitch-client.twitch.api.channels.Channels:reset_stream_key` (144:146) +- `python-twitch-client.twitch.api.channels.Channels:get_community` (148:150) + + +### Search API +This component offers functionalities for searching Twitch content, including channels, games, and streams. It enables users to discover various types of content available on the Twitch platform. + + +**Related Classes/Methods**: + +- `python-twitch-client.twitch.api.search.Search:channels` (7:15) +- `python-twitch-client.twitch.api.search.Search:games` (17:23) +- `python-twitch-client.twitch.api.search.Search:streams` (25:33) + + +### General API Endpoints +This component groups various Twitch API endpoints that provide functionalities for teams, videos, games, clips, and ingests. It serves as a consolidated interface for less frequently accessed or specialized API interactions. + + +**Related Classes/Methods**: + +- `python-twitch-client.twitch.api.teams.Teams:get` (7:9) +- `python-twitch-client.twitch.api.teams.Teams:get_all` (11:19) +- `python-twitch-client.twitch.api.videos.Videos:get_by_id` (15:17) +- `python-twitch-client.twitch.api.videos.Videos:get_top` (19:52) +- `python-twitch-client.twitch.api.videos.Videos:get_followed_videos` (55:73) +- `python-twitch-client.twitch.api.games.Games:get_top` (7:15) +- `python-twitch-client.twitch.api.clips.Clips:get_by_slug` (9:11) +- `python-twitch-client.twitch.api.clips.Clips:get_top` (13:44) +- `python-twitch-client.twitch.api.clips.Clips:followed` (47:56) +- `python-twitch-client.twitch.api.ingests.Ingests:get_server_list` (6:8) + + +### Twitch Exceptions +This component defines and handles exceptions specific to the Twitch API interactions, ensuring robust error management within the client. It provides a structured way to signal and manage errors encountered during API calls. + + +**Related Classes/Methods**: + +- `python-twitch-client.twitch.exceptions.TwitchAttributeException` (9:10) + + + + +### [FAQ](https://github.com/CodeBoarding/GeneratedOnBoardings/tree/main?tab=readme-ov-file#faq) \ No newline at end of file diff --git a/.codeboarding/on_boarding.md b/.codeboarding/on_boarding.md new file mode 100644 index 0000000..26d4db1 --- /dev/null +++ b/.codeboarding/on_boarding.md @@ -0,0 +1,167 @@ +```mermaid +graph LR + Twitch_API_Clients["Twitch API Clients"] + API_Request_Handling["API Request Handling"] + Twitch_Data_Models["Twitch Data Models"] + API_Configuration_Utilities["API Configuration & Utilities"] + Old_API_Specific_Endpoints["Old API Specific Endpoints"] + Twitch_API_Clients -- "uses" --> API_Configuration_Utilities + Twitch_API_Clients -- "delegates to" --> Old_API_Specific_Endpoints + Twitch_API_Clients -- "uses" --> API_Request_Handling + API_Request_Handling -- "uses" --> API_Configuration_Utilities + API_Request_Handling -- "produces" --> Twitch_Data_Models + Twitch_Data_Models -- "consumed by" --> Twitch_API_Clients + Twitch_Data_Models -- "consumed by" --> Old_API_Specific_Endpoints + API_Configuration_Utilities -- "used by" --> Twitch_API_Clients + API_Configuration_Utilities -- "used by" --> API_Request_Handling + Old_API_Specific_Endpoints -- "uses" --> API_Request_Handling + Old_API_Specific_Endpoints -- "produces" --> Twitch_Data_Models + Old_API_Specific_Endpoints -- "uses" --> API_Configuration_Utilities + click Twitch_API_Clients href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/python-twitch-client/Twitch API Clients.md" "Details" + click API_Request_Handling href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/python-twitch-client/API Request Handling.md" "Details" + click Twitch_Data_Models href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/python-twitch-client/Twitch Data Models.md" "Details" + click API_Configuration_Utilities href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/python-twitch-client/API Configuration & Utilities.md" "Details" + click Old_API_Specific_Endpoints href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/python-twitch-client/Old API Specific Endpoints.md" "Details" +``` +[![CodeBoarding](https://img.shields.io/badge/Generated%20by-CodeBoarding-9cf?style=flat-square)](https://github.com/CodeBoarding/GeneratedOnBoardings)[![Demo](https://img.shields.io/badge/Try%20our-Demo-blue?style=flat-square)](https://www.codeboarding.org/demo)[![Contact](https://img.shields.io/badge/Contact%20us%20-%20contact@codeboarding.org-lightgrey?style=flat-square)](mailto:contact@codeboarding.org) + +## Component Details + +This graph illustrates the architecture of the `python-twitch-client` library, which provides a comprehensive interface for interacting with both the older Twitch API (v5) and the newer Twitch Helix API. The core functionality revolves around making API requests, handling responses by converting them into Python objects, and managing authentication and configuration. + +### Twitch API Clients +Provides the main interfaces for interacting with both the older Twitch API (v5) and the newer Twitch Helix API, acting as a facade for different API versions and their respective functionalities. + + +**Related Classes/Methods**: + +- `python-twitch-client.twitch.client.TwitchClient:__init__` (24:43) +- `python-twitch-client.twitch.client.TwitchClient:channel_feed` (46:51) +- `python-twitch-client.twitch.client.TwitchClient:clips` (54:59) +- `python-twitch-client.twitch.client.TwitchClient:channels` (62:67) +- `python-twitch-client.twitch.client.TwitchClient:chat` (70:73) +- `python-twitch-client.twitch.client.TwitchClient:collections` (76:81) +- `python-twitch-client.twitch.client.TwitchClient:communities` (84:89) +- `python-twitch-client.twitch.client.TwitchClient:games` (92:97) +- `python-twitch-client.twitch.client.TwitchClient:ingests` (100:105) +- `python-twitch-client.twitch.client.TwitchClient:search` (108:113) +- `python-twitch-client.twitch.client.TwitchClient:streams` (116:121) +- `python-twitch-client.twitch.client.TwitchClient:teams` (124:129) +- `python-twitch-client.twitch.client.TwitchClient:users` (132:137) +- `python-twitch-client.twitch.client.TwitchClient:videos` (140:145) +- `python-twitch-client.twitch.helix.api.TwitchHelix:__init__` (32:41) +- `python-twitch-client.twitch.helix.api.TwitchHelix:get_oauth` (43:70) +- `python-twitch-client.twitch.helix.api.TwitchHelix:get_streams` (72:118) +- `python-twitch-client.twitch.helix.api.TwitchHelix:get_games` (120:136) +- `python-twitch-client.twitch.helix.api.TwitchHelix:get_clips` (138:187) +- `python-twitch-client.twitch.helix.api.TwitchHelix:get_top_games` (189:205) +- `python-twitch-client.twitch.helix.api.TwitchHelix:get_videos` (207:271) +- `python-twitch-client.twitch.helix.api.TwitchHelix:get_streams_metadata` (273:319) +- `python-twitch-client.twitch.helix.api.TwitchHelix:get_user_follows` (321:340) +- `python-twitch-client.twitch.helix.api.TwitchHelix:get_users` (342:358) +- `python-twitch-client.twitch.helix.api.TwitchHelix:get_tags` (360:376) + + +### API Request Handling +Manages the underlying HTTP communication with both Twitch API v5 and Helix endpoints, including handling request headers, rate limits, and pagination for efficient data retrieval. + + +**Related Classes/Methods**: + +- `python-twitch-client.twitch.api.base.TwitchAPI:__init__` (15:20) +- `python-twitch-client.twitch.api.base.TwitchAPI:_get_request_headers` (22:32) +- `python-twitch-client.twitch.api.base.TwitchAPI:_request_get` (34:57) +- `python-twitch-client.twitch.api.base.TwitchAPI:_request_post` (59:70) +- `python-twitch-client.twitch.api.base.TwitchAPI:_request_put` (72:82) +- `python-twitch-client.twitch.api.base.TwitchAPI:_request_delete` (84:95) +- `python-twitch-client.twitch.helix.base.TwitchAPIMixin:_wait_for_rate_limit_reset` (18:38) +- `python-twitch-client.twitch.helix.base.TwitchAPIMixin:_get_request_headers` (40:46) +- `python-twitch-client.twitch.helix.base.TwitchAPIMixin:_request_get` (48:76) +- `python-twitch-client.twitch.helix.base.APICursor:__init__` (80:95) +- `python-twitch-client.twitch.helix.base.APICursor:next_page` (118:133) +- `python-twitch-client.twitch.helix.base.APICursor:total` (140:143) +- `python-twitch-client.twitch.helix.base.APIGet:fetch` (155:157) + + +### Twitch Data Models +Defines the Python object structures for representing various Twitch API resources, facilitating the conversion of raw API responses into easily manipulable objects within the application. + + +**Related Classes/Methods**: + +- `python-twitch-client.twitch.resources:convert_to_twitch_object` (4:34) +- `python-twitch-client.twitch.resources.TwitchObject:construct_from` (58:61) +- `python-twitch-client.twitch.resources.TwitchObject:refresh_from` (63:65) +- `python-twitch-client.twitch.resources.TwitchObject.__setitem__` (53:55) +- `python-twitch-client.twitch.resources.Channel` (81:82) +- `python-twitch-client.twitch.resources.Clip` (85:86) +- `python-twitch-client.twitch.resources.Collection` (89:90) +- `python-twitch-client.twitch.resources.Comment` (93:94) +- `python-twitch-client.twitch.resources.Community` (97:98) +- `python-twitch-client.twitch.resources.Featured` (101:102) +- `python-twitch-client.twitch.resources.Follow` (105:106) +- `python-twitch-client.twitch.resources.Game` (109:110) +- `python-twitch-client.twitch.resources.Ingest` (113:114) +- `python-twitch-client.twitch.resources.Item` (117:118) +- `python-twitch-client.twitch.resources.Post` (121:122) +- `python-twitch-client.twitch.resources.Stream` (125:126) +- `python-twitch-client.twitch.resources.StreamMetadata` (129:130) +- `python-twitch-client.twitch.resources.Subscription` (133:134) +- `python-twitch-client.twitch.resources.Tag` (137:138) +- `python-twitch-client.twitch.resources.Team` (141:142) +- `python-twitch-client.twitch.resources.TopGame` (145:146) +- `python-twitch-client.twitch.resources.User` (149:150) +- `python-twitch-client.twitch.resources.UserBlock` (153:154) +- `python-twitch-client.twitch.resources.Video` (157:158) + + +### API Configuration & Utilities +Handles the loading and management of API credentials and settings, provides custom exception handling for API-related errors, and enforces authentication requirements for sensitive operations. + + +**Related Classes/Methods**: + +- `python-twitch-client.twitch.conf:credentials_from_config_file` (13:22) +- `python-twitch-client.twitch.conf:backoff_config` (25:34) +- `python-twitch-client.twitch.conf._get_config` (7:10) +- `twitch.exceptions.TwitchException` (1:2) +- `twitch.exceptions.TwitchAuthException` (5:6) +- `twitch.exceptions.TwitchAttributeException` (9:10) +- `twitch.exceptions.TwitchNotProvidedException` (13:14) +- `twitch.exceptions.TwitchOAuthException` (17:18) +- `python-twitch-client.twitch.decorators.oauth_required` (4:10) + + +### Old API Specific Endpoints +Encapsulates the specific functionalities and methods for interacting with various categories of the older Twitch API (v5), such as channels, streams, users, and communities. + + +**Related Classes/Methods**: + +- `python-twitch-client.twitch.api.collections.Collections:get_metadata` (8:10) +- `python-twitch-client.twitch.api.collections.Collections:get` (12:17) +- `python-twitch-client.twitch.api.collections.Collections:get_by_channel` (19:31) +- `python-twitch-client.twitch.api.collections.Collections:create` (34:41) +- `python-twitch-client.twitch.api.collections.Collections:update` (44:48) +- `python-twitch-client.twitch.api.collections.Collections:create_thumbnail` (51:55) +- `python-twitch-client.twitch.api.collections.Collections:delete` (58:59) +- `python-twitch-client.twitch.api.collections.Collections:add_item` (62:67) +- `python-twitch-client.twitch.api.collections.Collections:delete_item` (70:72) +- `python-twitch-client.twitch.api.collections.Collections:move_item` (75:78) +- `python-twitch-client.twitch.api.streams.Streams` (8:83) +- `python-twitch-client.twitch.api.users.Users` (14:130) +- `python-twitch-client.twitch.api.chat.Chat` (4:18) +- `python-twitch-client.twitch.api.communities.Communities` (7:136) +- `python-twitch-client.twitch.api.channel_feed.ChannelFeed` (7:105) +- `python-twitch-client.twitch.api.teams.Teams` (6:19) +- `python-twitch-client.twitch.api.videos.Videos` (14:88) +- `python-twitch-client.twitch.api.games.Games` (6:15) +- `python-twitch-client.twitch.api.channels.Channels` (16:156) +- `python-twitch-client.twitch.api.clips.Clips` (8:56) +- `python-twitch-client.twitch.api.ingests.Ingests` (5:8) +- `python-twitch-client.twitch.api.search.Search` (6:33) + + + + +### [FAQ](https://github.com/CodeBoarding/GeneratedOnBoardings/tree/main?tab=readme-ov-file#faq) \ No newline at end of file