Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
fe29e21
Added high-level diagrams
ivanmilevtues Jun 9, 2025
5b07d62
Merge branch 'praw-dev:main' into main
ivanmilevtues Sep 1, 2025
3a196f6
Added github action
ivanmilevtues Sep 1, 2025
f2a2e78
Added codeboarding
ivanmilevtues Sep 1, 2025
65be4da
docs: update codeboarding documentation
actions-user Sep 1, 2025
3acb442
Change default to .rst
ivanmilevtues Sep 1, 2025
5dcaebd
docs: update codeboarding documentation
actions-user Sep 1, 2025
55a62c2
docs: update codeboarding documentation
actions-user Sep 1, 2025
ca26447
Updates on the github action and adding the results to the docs
ivanmilevtues Sep 1, 2025
77a7068
docs: update codeboarding documentation
actions-user Sep 1, 2025
3a1249a
Removed files for fresh run
ivanmilevtues Sep 1, 2025
b55cb54
docs: update codeboarding documentation
actions-user Sep 1, 2025
6b3fa89
Small fix
ivanmilevtues Sep 1, 2025
ee31f5b
docs: update codeboarding documentation
actions-user Sep 1, 2025
734fc82
adding readdocs integration
ivanmilevtues Sep 1, 2025
56cf610
Merge branch 'praw-dev:main' into main
ivanmilevtues Sep 1, 2025
243a716
docs: update codeboarding documentation
actions-user Sep 1, 2025
acb8067
docs: update codeboarding documentation
actions-user Sep 7, 2025
de46108
docs: update codeboarding documentation
actions-user Sep 14, 2025
090164f
docs: update codeboarding documentation
actions-user Sep 21, 2025
aaf35ed
docs: update codeboarding documentation
actions-user Sep 28, 2025
dfc529d
docs: update codeboarding documentation
actions-user Oct 5, 2025
38807c4
docs: update codeboarding documentation
actions-user Oct 12, 2025
ea80ca6
docs: update codeboarding documentation
actions-user Oct 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .codeboarding/Configuration_Manager.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"description": "The PRAW library's core architecture is centered around two main components: the Configuration Manager and the Reddit API Client. The Configuration Manager, implemented by the praw.config.Config class, is responsible for abstracting and providing all necessary configuration settings, such as API credentials and user agent information, which can be sourced from praw.ini files or environment variables. This ensures a flexible and centralized approach to managing application settings. The Reddit API Client, represented by the praw.Reddit.Reddit class, serves as the primary interface for interacting with the Reddit API. It critically depends on the Configuration Manager to obtain its initialization parameters, enabling it to establish authenticated sessions and facilitate all subsequent API requests. This clear separation of concerns allows for robust configuration handling and a streamlined API interaction experience.",
"components": [
{
"name": "Configuration Manager",
"description": "This component is responsible for centralizing the loading, parsing, and provision of PRAW's configuration settings. It abstracts the underlying storage mechanisms (e.g., praw.ini file, environment variables) and offers a unified interface for retrieving critical API access parameters such as client ID, client secret, user agent, and redirect URI. These parameters are fundamental for establishing a connection and authenticating with the Reddit API.",
"referenced_source_code": [
{
"qualified_name": "praw.config.Config",
"reference_file": "praw/config.py",
"reference_start_line": 52,
"reference_end_line": 52
}
]
},
{
"name": "Reddit API Client",
"description": "As the main API client, this component serves as the primary interface for all interactions with the Reddit API. It requires the configuration parameters managed by the Configuration Manager to initialize itself, authenticate, and make requests. It acts as the entry point for developers to access various Reddit resources and functionalities.",
"referenced_source_code": [
{
"qualified_name": "praw.Reddit.Reddit",
"reference_file": "praw/reddit.py",
"reference_start_line": 57,
"reference_end_line": 901
}
]
},
{
"name": "Unclassified",
"description": "Component for all unclassified files and utility functions (Utility functions/External Libraries/Dependencies)",
"referenced_source_code": []
}
],
"components_relations": [
{
"relation": "provides configuration to",
"src_name": "Configuration Manager",
"dst_name": "Reddit API Client"
}
]
}
52 changes: 52 additions & 0 deletions .codeboarding/Configuration_Manager.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
Configuration Manager
=====================

.. mermaid::

graph LR
Configuration_Manager["Configuration Manager"]
Reddit_API_Client["Reddit API Client"]
Unclassified["Unclassified"]
Configuration_Manager -- "provides configuration to" --> Reddit_API_Client
click Configuration_Manager href "https://github.com/CodeBoarding/praw/blob/main/.codeboarding/Configuration_Manager.html" "Details"

| |codeboarding-badge| |demo-badge| |contact-badge|

.. |codeboarding-badge| image:: https://img.shields.io/badge/Generated%20by-CodeBoarding-9cf?style=flat-square
:target: https://github.com/CodeBoarding/CodeBoarding
.. |demo-badge| image:: https://img.shields.io/badge/Try%20our-Demo-blue?style=flat-square
:target: https://www.codeboarding.org/demo
.. |contact-badge| image:: https://img.shields.io/badge/Contact%20us%20-%[email protected]?style=flat-square
:target: mailto:[email protected]

Details
-------

The PRAW library's core architecture is centered around two main components: the Configuration Manager and the Reddit API Client. The Configuration Manager, implemented by the praw.config.Config class, is responsible for abstracting and providing all necessary configuration settings, such as API credentials and user agent information, which can be sourced from praw.ini files or environment variables. This ensures a flexible and centralized approach to managing application settings. The Reddit API Client, represented by the praw.Reddit.Reddit class, serves as the primary interface for interacting with the Reddit API. It critically depends on the Configuration Manager to obtain its initialization parameters, enabling it to establish authenticated sessions and facilitate all subsequent API requests. This clear separation of concerns allows for robust configuration handling and a streamlined API interaction experience.

Configuration Manager
^^^^^^^^^^^^^^^^^^^^^

:ref:`Expand <Configuration_Manager>`

This component is responsible for centralizing the loading, parsing, and provision of PRAW's configuration settings. It abstracts the underlying storage mechanisms (e.g., praw.ini file, environment variables) and offers a unified interface for retrieving critical API access parameters such as client ID, client secret, user agent, and redirect URI. These parameters are fundamental for establishing a connection and authenticating with the Reddit API.

**Related Classes/Methods**:

* praw.config.Config

Reddit API Client
^^^^^^^^^^^^^^^^^

As the main API client, this component serves as the primary interface for all interactions with the Reddit API. It requires the configuration parameters managed by the Configuration Manager to initialize itself, authenticate, and make requests. It acts as the entry point for developers to access various Reddit resources and functionalities.

**Related Classes/Methods**:

* praw.Reddit.Reddit:57-901

Unclassified
^^^^^^^^^^^^

Component for all unclassified files and utility functions (Utility functions/External Libraries/Dependencies)

**Related Classes/Methods**: *None*
143 changes: 143 additions & 0 deletions .codeboarding/Listing_Streaming.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
{
"description": "The PRAW library's data retrieval architecture is primarily composed of two distinct but complementary patterns: listing generation and stream generation. The ListingGenerator forms the backbone for paginated data retrieval, efficiently fetching and iterating through large datasets from the Reddit API. This core functionality is extended and specialized by BaseListingMixin, SubredditListingMixin, and RedditorListingMixin, which provide context-specific listing capabilities for general, subreddit, and redditor content, respectively. For real-time data, the StreamGenerator (implemented as stream_generator utility) offers a robust mechanism for continuous data delivery, handling deduplication and rate limiting. This utility is leveraged by higher-level stream methods within Redditors, Inbox, and Subreddits classes, providing user-friendly entry points for accessing live streams of redditors, inbox messages, and subreddit content. This dual approach ensures comprehensive and efficient access to both historical and real-time Reddit data.",
"components": [
{
"name": "ListingGenerator",
"description": "Manages the iteration and pagination of items from Reddit API responses. It handles fetching data in batches, extracting relevant sub-lists, and providing an iterable interface to the user, abstracting away pagination details. This component is crucial for efficiently handling large datasets from the Reddit API.",
"referenced_source_code": [
{
"qualified_name": "ListingGenerator",
"reference_file": "/home/ubuntu/CodeBoarding/repo/praw/praw/models/listing/generator.py",
"reference_start_line": 17,
"reference_end_line": 103
}
]
},
{
"name": "BaseListingMixin",
"description": "Provides foundational listing methods such as `hot`, `new`, `top`, and `controversial`. It prepares generic API requests and validates time filters applicable across various Reddit resources, serving as a common interface for listing operations.",
"referenced_source_code": [
{
"qualified_name": "BaseListingMixin",
"reference_file": "/home/ubuntu/CodeBoarding/repo/praw/praw/models/listing/mixins/base.py",
"reference_start_line": 15,
"reference_end_line": 149
}
]
},
{
"name": "SubredditListingMixin",
"description": "Specializes listing functionality for subreddit-specific content, including comments and submissions within a subreddit. It determines appropriate API paths for subreddit-related data, extending the base listing capabilities.",
"referenced_source_code": [
{
"qualified_name": "SubredditListingMixin",
"reference_file": "/home/ubuntu/CodeBoarding/repo/praw/praw/models/listing/mixins/subreddit.py",
"reference_start_line": 49,
"reference_end_line": 73
}
]
},
{
"name": "RedditorListingMixin",
"description": "Specializes listing functionality for redditor-specific content, such as comments and submissions made by a particular user. It creates sub-listings tailored to user activity, providing a user-centric view of Reddit data.",
"referenced_source_code": [
{
"qualified_name": "RedditorListingMixin",
"reference_file": "/home/ubuntu/CodeBoarding/repo/praw/praw/models/listing/mixins/redditor.py",
"reference_start_line": 35,
"reference_end_line": 185
}
]
},
{
"name": "StreamGenerator",
"description": "This component, implemented as the `stream_generator` function, provides a generic, low-level mechanism for continuously yielding new items from a source. It manages the stream's state, handles deduplication using a `BoundedSet`, and incorporates exponential backoff for rate limiting, forming the core engine for all streaming operations. This is the fundamental utility for real-time data.",
"referenced_source_code": [
{
"qualified_name": "stream_generator",
"reference_file": "/home/ubuntu/CodeBoarding/repo/praw/praw/models/util.py",
"reference_start_line": 36,
"reference_end_line": 163
}
]
},
{
"name": "RedditorsStream",
"description": "Represents the `stream` method within the `Redditors` class, acting as an entry point for initiating and managing a continuous stream of new redditors as they are created or become active. It provides a high-level interface for accessing real-time user data by leveraging the `stream_generator` utility.",
"referenced_source_code": [
{
"qualified_name": "Redditors.stream",
"reference_file": "/home/ubuntu/CodeBoarding/repo/praw/praw/models/redditors.py",
"reference_start_line": 93,
"reference_end_line": 104
}
]
},
{
"name": "InboxStream",
"description": "Represents the `stream` method within the `Inbox` class, acting as an entry point for initiating and managing a continuous stream of unread inbox messages for the authenticated user. This component is vital for real-time notification and interaction features, leveraging the `stream_generator` utility.",
"referenced_source_code": [
{
"qualified_name": "Inbox.stream",
"reference_file": "/home/ubuntu/CodeBoarding/repo/praw/praw/models/inbox.py",
"reference_start_line": 229,
"reference_end_line": 247
}
]
},
{
"name": "SubredditContentStream",
"description": "Represents the `stream` method within the `Subreddits` class, providing access to streams of content related to a specific subreddit, including specialized moderation streams. This allows for real-time monitoring of activity within a subreddit by leveraging the `stream_generator` utility.",
"referenced_source_code": [
{
"qualified_name": "Subreddits.stream",
"reference_file": "/home/ubuntu/CodeBoarding/repo/praw/praw/models/subreddits.py",
"reference_start_line": 124,
"reference_end_line": 133
}
]
}
],
"components_relations": [
{
"relation": "specializes",
"src_name": "SubredditListingMixin",
"dst_name": "BaseListingMixin"
},
{
"relation": "specializes",
"src_name": "RedditorListingMixin",
"dst_name": "BaseListingMixin"
},
{
"relation": "utilizes",
"src_name": "BaseListingMixin",
"dst_name": "ListingGenerator"
},
{
"relation": "utilizes",
"src_name": "SubredditListingMixin",
"dst_name": "ListingGenerator"
},
{
"relation": "utilizes",
"src_name": "RedditorListingMixin",
"dst_name": "ListingGenerator"
},
{
"relation": "leverages",
"src_name": "RedditorsStream",
"dst_name": "StreamGenerator"
},
{
"relation": "leverages",
"src_name": "InboxStream",
"dst_name": "StreamGenerator"
},
{
"relation": "leverages",
"src_name": "SubredditContentStream",
"dst_name": "StreamGenerator"
}
]
}
108 changes: 108 additions & 0 deletions .codeboarding/Listing_Streaming.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
Listing Streaming
=================

.. mermaid::

graph LR
ListingGenerator["ListingGenerator"]
BaseListingMixin["BaseListingMixin"]
SubredditListingMixin["SubredditListingMixin"]
RedditorListingMixin["RedditorListingMixin"]
StreamGenerator["StreamGenerator"]
RedditorsStream["RedditorsStream"]
InboxStream["InboxStream"]
SubredditContentStream["SubredditContentStream"]
SubredditListingMixin -- "specializes" --> BaseListingMixin
RedditorListingMixin -- "specializes" --> BaseListingMixin
BaseListingMixin -- "utilizes" --> ListingGenerator
SubredditListingMixin -- "utilizes" --> ListingGenerator
RedditorListingMixin -- "utilizes" --> ListingGenerator
RedditorsStream -- "leverages" --> StreamGenerator
InboxStream -- "leverages" --> StreamGenerator
SubredditContentStream -- "leverages" --> StreamGenerator

| |codeboarding-badge| |demo-badge| |contact-badge|

.. |codeboarding-badge| image:: https://img.shields.io/badge/Generated%20by-CodeBoarding-9cf?style=flat-square
:target: https://github.com/CodeBoarding/CodeBoarding
.. |demo-badge| image:: https://img.shields.io/badge/Try%20our-Demo-blue?style=flat-square
:target: https://www.codeboarding.org/demo
.. |contact-badge| image:: https://img.shields.io/badge/Contact%20us%20-%[email protected]?style=flat-square
:target: mailto:[email protected]

Details
-------

The PRAW library's data retrieval architecture is primarily composed of two distinct but complementary patterns: listing generation and stream generation. The ListingGenerator forms the backbone for paginated data retrieval, efficiently fetching and iterating through large datasets from the Reddit API. This core functionality is extended and specialized by BaseListingMixin, SubredditListingMixin, and RedditorListingMixin, which provide context-specific listing capabilities for general, subreddit, and redditor content, respectively. For real-time data, the StreamGenerator (implemented as stream_generator utility) offers a robust mechanism for continuous data delivery, handling deduplication and rate limiting. This utility is leveraged by higher-level stream methods within Redditors, Inbox, and Subreddits classes, providing user-friendly entry points for accessing live streams of redditors, inbox messages, and subreddit content. This dual approach ensures comprehensive and efficient access to both historical and real-time Reddit data.

ListingGenerator
^^^^^^^^^^^^^^^^

Manages the iteration and pagination of items from Reddit API responses. It handles fetching data in batches, extracting relevant sub-lists, and providing an iterable interface to the user, abstracting away pagination details. This component is crucial for efficiently handling large datasets from the Reddit API.

**Related Classes/Methods**:

* `ListingGenerator:17-103 <https://github.com/CodeBoarding/praw/blob/main/praw/models/listing/generator.py#L17-L103>`_

BaseListingMixin
^^^^^^^^^^^^^^^^

Provides foundational listing methods such as `hot`, `new`, `top`, and `controversial`. It prepares generic API requests and validates time filters applicable across various Reddit resources, serving as a common interface for listing operations.

**Related Classes/Methods**:

* `BaseListingMixin:15-149 <https://github.com/CodeBoarding/praw/blob/main/praw/models/listing/mixins/base.py#L15-L149>`_

SubredditListingMixin
^^^^^^^^^^^^^^^^^^^^^

Specializes listing functionality for subreddit-specific content, including comments and submissions within a subreddit. It determines appropriate API paths for subreddit-related data, extending the base listing capabilities.

**Related Classes/Methods**:

* `SubredditListingMixin:49-73 <https://github.com/CodeBoarding/praw/blob/main/praw/models/listing/mixins/subreddit.py#L49-L73>`_

RedditorListingMixin
^^^^^^^^^^^^^^^^^^^^

Specializes listing functionality for redditor-specific content, such as comments and submissions made by a particular user. It creates sub-listings tailored to user activity, providing a user-centric view of Reddit data.

**Related Classes/Methods**:

* `RedditorListingMixin:35-185 <https://github.com/CodeBoarding/praw/blob/main/praw/models/listing/mixins/redditor.py#L35-L185>`_

StreamGenerator
^^^^^^^^^^^^^^^

This component, implemented as the `stream_generator` function, provides a generic, low-level mechanism for continuously yielding new items from a source. It manages the stream's state, handles deduplication using a `BoundedSet`, and incorporates exponential backoff for rate limiting, forming the core engine for all streaming operations. This is the fundamental utility for real-time data.

**Related Classes/Methods**:

* `stream_generator:36-163 <https://github.com/CodeBoarding/praw/blob/main/praw/models/util.py#L36-L163>`_

RedditorsStream
^^^^^^^^^^^^^^^

Represents the `stream` method within the `Redditors` class, acting as an entry point for initiating and managing a continuous stream of new redditors as they are created or become active. It provides a high-level interface for accessing real-time user data by leveraging the `stream_generator` utility.

**Related Classes/Methods**:

* `Redditors.stream:93-104 <https://github.com/CodeBoarding/praw/blob/main/praw/models/redditors.py#L93-L104>`_

InboxStream
^^^^^^^^^^^

Represents the `stream` method within the `Inbox` class, acting as an entry point for initiating and managing a continuous stream of unread inbox messages for the authenticated user. This component is vital for real-time notification and interaction features, leveraging the `stream_generator` utility.

**Related Classes/Methods**:

* `Inbox.stream:229-247 <https://github.com/CodeBoarding/praw/blob/main/praw/models/inbox.py#L229-L247>`_

SubredditContentStream
^^^^^^^^^^^^^^^^^^^^^^

Represents the `stream` method within the `Subreddits` class, providing access to streams of content related to a specific subreddit, including specialized moderation streams. This allows for real-time monitoring of activity within a subreddit by leveraging the `stream_generator` utility.

**Related Classes/Methods**:

* `Subreddits.stream:124-133 <https://github.com/CodeBoarding/praw/blob/main/praw/models/subreddits.py#L124-L133>`_
Loading