Skip to content

Commit fe29e21

Browse files
committed
Added high-level diagrams
1 parent 4ee241e commit fe29e21

7 files changed

Lines changed: 1129 additions & 0 deletions
Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
```mermaid
2+
graph LR
3+
Reddit_Client["Reddit Client"]
4+
Content_Listing_Management["Content & Listing Management"]
5+
Listing_Generators["Listing Generators"]
6+
Comment_Objects["Comment Objects"]
7+
Submission_Objects["Submission Objects"]
8+
Subreddit_Objects["Subreddit Objects"]
9+
User_Objects["User Objects"]
10+
Inbox_Manager["Inbox Manager"]
11+
Draft_Management["Draft Management"]
12+
Stream_Utilities["Stream Utilities"]
13+
Listing_Mixins["Listing Mixins"]
14+
Reddit_Client -- "Provides access to" --> Comment_Objects
15+
Reddit_Client -- "Provides access to" --> Submission_Objects
16+
Reddit_Client -- "Provides access to" --> Subreddit_Objects
17+
Reddit_Client -- "Provides access to" --> User_Objects
18+
Reddit_Client -- "Manages user inbox through" --> Inbox_Manager
19+
Reddit_Client -- "Manages drafts through" --> Draft_Management
20+
Reddit_Client -- "Provides access to" --> Content_Listing_Management
21+
Content_Listing_Management -- "Uses" --> Listing_Generators
22+
Content_Listing_Management -- "Manages" --> Comment_Objects
23+
Content_Listing_Management -- "Manages" --> Submission_Objects
24+
Content_Listing_Management -- "Uses" --> Listing_Mixins
25+
Content_Listing_Management -- "Uses" --> Draft_Management
26+
Content_Listing_Management -- "Uses" --> Stream_Utilities
27+
Inbox_Manager -- "Uses for data retrieval" --> Listing_Generators
28+
Listing_Mixins -- "Implements listings via" --> Listing_Generators
29+
Stream_Utilities -- "Can consume output from" --> Listing_Generators
30+
Comment_Objects -- "Forms hierarchical structures with" --> Comment_Objects
31+
Submission_Objects -- "Contains comments" --> Comment_Objects
32+
Subreddit_Objects -- "Receives submissions" --> Submission_Objects
33+
Subreddit_Objects -- "Extends with listing features" --> Listing_Mixins
34+
User_Objects -- "Enables streaming of user content" --> Stream_Utilities
35+
Subreddit_Objects -- "Enables streaming of subreddit content" --> Stream_Utilities
36+
Listing_Generators -- "Produces" --> Comment_Objects
37+
Listing_Generators -- "Produces" --> Submission_Objects
38+
Listing_Generators -- "Produces" --> User_Objects
39+
Listing_Generators -- "Produces" --> Subreddit_Objects
40+
```
41+
[![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)
42+
43+
## Component Details
44+
45+
This graph illustrates the architecture of the Content & Listing Management subsystem within the PRAW library, focusing on how it retrieves, iterates, and manages various types of Reddit content. The core functionality revolves around efficient listing generation and the handling of submissions, comments, and related data like drafts and polls. It interacts with the central Reddit Client for API access and leverages specialized components for listing generation, stream utilities, and specific Reddit object management.
46+
47+
### Reddit Client
48+
The central entry point for interacting with the Reddit API, managing authentication and providing access to various Reddit entities.
49+
50+
51+
**Related Classes/Methods**:
52+
53+
- <a href="https://github.com/praw-dev/praw/blob/master/praw/reddit.py#L57-L901" target="_blank" rel="noopener noreferrer">`praw.praw.reddit.Reddit` (57:901)</a>
54+
55+
56+
### Content & Listing Management
57+
Responsible for efficiently retrieving and iterating through various types of content listings from Reddit, such as hot, new, or top posts. It also provides utilities for real-time data streams and handles the creation, retrieval, and general management of Reddit submissions (posts) and comments, including drafts and poll data.
58+
59+
60+
**Related Classes/Methods**:
61+
62+
- <a href="https://github.com/praw-dev/praw/blob/master/praw/models/listing/generator.py#L17-L103" target="_blank" rel="noopener noreferrer">`praw.praw.models.listing.generator.ListingGenerator` (17:103)</a>
63+
- <a href="https://github.com/praw-dev/praw/blob/master/praw/models/listing/domain.py#L14-L25" target="_blank" rel="noopener noreferrer">`praw.praw.models.listing.domain.DomainListing` (14:25)</a>
64+
- <a href="https://github.com/praw-dev/praw/blob/master/praw/models/listing/mixins/redditor.py#L18-L32" target="_blank" rel="noopener noreferrer">`praw.praw.models.listing.mixins.redditor.SubListing` (18:32)</a>
65+
- <a href="https://github.com/praw-dev/praw/blob/master/praw/models/listing/mixins/redditor.py#L35-L185" target="_blank" rel="noopener noreferrer">`praw.praw.models.listing.mixins.redditor.RedditorListingMixin` (35:185)</a>
66+
- <a href="https://github.com/praw-dev/praw/blob/master/praw/models/listing/mixins/subreddit.py#L20-L46" target="_blank" rel="noopener noreferrer">`praw.praw.models.listing.mixins.subreddit.CommentHelper` (20:46)</a>
67+
- <a href="https://github.com/praw-dev/praw/blob/master/praw/models/listing/mixins/subreddit.py#L49-L73" target="_blank" rel="noopener noreferrer">`praw.praw.models.listing.mixins.subreddit.SubredditListingMixin` (49:73)</a>
68+
- <a href="https://github.com/praw-dev/praw/blob/master/praw/models/listing/mixins/rising.py#L17-L34" target="_blank" rel="noopener noreferrer">`praw.praw.models.listing.mixins.rising.RisingListingMixin` (17:34)</a>
69+
- <a href="https://github.com/praw-dev/praw/blob/master/praw/models/listing/mixins/base.py#L15-L149" target="_blank" rel="noopener noreferrer">`praw.praw.models.listing.mixins.base.BaseListingMixin` (15:149)</a>
70+
- <a href="https://github.com/praw-dev/praw/blob/master/praw/models/listing/mixins/submission.py#L17-L42" target="_blank" rel="noopener noreferrer">`praw.praw.models.listing.mixins.submission.SubmissionListingMixin` (17:42)</a>
71+
- <a href="https://github.com/praw-dev/praw/blob/master/praw/models/util.py#L10-L190" target="_blank" rel="noopener noreferrer">`praw.praw.models.util` (10:190)</a>
72+
- <a href="https://github.com/praw-dev/praw/blob/master/praw/models/comment_forest.py#L15-L202" target="_blank" rel="noopener noreferrer">`praw.praw.models.comment_forest.CommentForest` (15:202)</a>
73+
- <a href="https://github.com/praw-dev/praw/blob/master/praw/models/reddit/comment.py#L19-L311" target="_blank" rel="noopener noreferrer">`praw.praw.models.reddit.comment.Comment` (19:311)</a>
74+
- <a href="https://github.com/praw-dev/praw/blob/master/praw/models/reddit/comment.py#L314-L350" target="_blank" rel="noopener noreferrer">`praw.praw.models.reddit.comment.CommentModeration` (314:350)</a>
75+
- <a href="https://github.com/praw-dev/praw/blob/master/praw/models/reddit/more.py#L14-L87" target="_blank" rel="noopener noreferrer">`praw.praw.models.reddit.more.MoreComments` (14:87)</a>
76+
- <a href="https://github.com/praw-dev/praw/blob/master/praw/models/reddit/submission.py#L395-L916" target="_blank" rel="noopener noreferrer">`praw.praw.models.reddit.submission.Submission` (395:916)</a>
77+
- <a href="https://github.com/praw-dev/praw/blob/master/praw/models/reddit/submission.py#L40-L90" target="_blank" rel="noopener noreferrer">`praw.praw.models.reddit.submission.SubmissionFlair` (40:90)</a>
78+
- <a href="https://github.com/praw-dev/praw/blob/master/praw/models/reddit/submission.py#L93-L392" target="_blank" rel="noopener noreferrer">`praw.praw.models.reddit.submission.SubmissionModeration` (93:392)</a>
79+
- <a href="https://github.com/praw-dev/praw/blob/master/praw/models/helpers.py#L20-L133" target="_blank" rel="noopener noreferrer">`praw.praw.models.helpers.DraftHelper` (20:133)</a>
80+
- <a href="https://github.com/praw-dev/praw/blob/master/praw/models/reddit/draft.py#L17-L292" target="_blank" rel="noopener noreferrer">`praw.praw.models.reddit.draft.Draft` (17:292)</a>
81+
- <a href="https://github.com/praw-dev/praw/blob/master/praw/models/reddit/poll.py#L47-L112" target="_blank" rel="noopener noreferrer">`praw.praw.models.reddit.poll.PollData` (47:112)</a>
82+
- <a href="https://github.com/praw-dev/praw/blob/master/praw/models/reddit/poll.py#L11-L44" target="_blank" rel="noopener noreferrer">`praw.praw.models.reddit.poll.PollOption` (11:44)</a>
83+
84+
85+
### Listing Generators
86+
A core component responsible for iterating and fetching paginated lists of various Reddit objects.
87+
88+
89+
**Related Classes/Methods**:
90+
91+
- <a href="https://github.com/praw-dev/praw/blob/master/praw/models/listing/generator.py#L17-L103" target="_blank" rel="noopener noreferrer">`praw.models.listing.generator.ListingGenerator` (17:103)</a>
92+
93+
94+
### Comment Objects
95+
Represents individual Reddit comments, providing methods for interaction and retrieval of related data.
96+
97+
98+
**Related Classes/Methods**:
99+
100+
- <a href="https://github.com/praw-dev/praw/blob/master/praw/models/reddit/comment.py#L19-L311" target="_blank" rel="noopener noreferrer">`praw.praw.models.reddit.comment.Comment` (19:311)</a>
101+
102+
103+
### Submission Objects
104+
Represents Reddit posts (submissions), offering functionalities for content manipulation and moderation.
105+
106+
107+
**Related Classes/Methods**:
108+
109+
- <a href="https://github.com/praw-dev/praw/blob/master/praw/models/reddit/submission.py#L395-L916" target="_blank" rel="noopener noreferrer">`praw.praw.models.reddit.submission.Submission` (395:916)</a>
110+
111+
112+
### Subreddit Objects
113+
Represents Reddit communities (subreddits), enabling content submission and moderation within them.
114+
115+
116+
**Related Classes/Methods**:
117+
118+
- `praw.praw.models.reddit.subreddit.Subreddit` (full file reference)
119+
120+
121+
### User Objects
122+
Represents Reddit user accounts, providing access to user-specific content and profiles.
123+
124+
125+
**Related Classes/Methods**:
126+
127+
- <a href="https://github.com/praw-dev/praw/blob/master/praw/models/reddit/redditor.py#L21-L409" target="_blank" rel="noopener noreferrer">`praw.praw.models.reddit.redditor.Redditor` (21:409)</a>
128+
129+
130+
### Inbox Manager
131+
Manages the authenticated user's Reddit inbox, allowing retrieval of messages, comment replies, and mentions.
132+
133+
134+
**Related Classes/Methods**:
135+
136+
- <a href="https://github.com/praw-dev/praw/blob/master/praw/models/inbox.py#L18-L324" target="_blank" rel="noopener noreferrer">`praw.praw.models.inbox.Inbox` (18:324)</a>
137+
138+
139+
### Draft Management
140+
Provides utilities for creating and managing submission drafts.
141+
142+
143+
**Related Classes/Methods**:
144+
145+
- <a href="https://github.com/praw-dev/praw/blob/master/praw/models/helpers.py#L20-L133" target="_blank" rel="noopener noreferrer">`praw.praw.models.helpers.DraftHelper` (20:133)</a>
146+
147+
148+
### Stream Utilities
149+
Offers helper functions for continuously streaming new Reddit content, such as comments or submissions.
150+
151+
152+
**Related Classes/Methods**:
153+
154+
- <a href="https://github.com/praw-dev/praw/blob/master/praw/models/util.py#L36-L163" target="_blank" rel="noopener noreferrer">`praw.praw.models.util.stream_generator` (36:163)</a>
155+
156+
157+
### Listing Mixins
158+
Abstract classes providing common methods for fetching various types of listings (e.g., hot, new, top) across different Reddit entities.
159+
160+
161+
**Related Classes/Methods**:
162+
163+
- <a href="https://github.com/praw-dev/praw/blob/master/praw/models/listing/mixins/base.py#L15-L149" target="_blank" rel="noopener noreferrer">`praw.praw.models.listing.mixins.base.BaseListingMixin` (15:149)</a>
164+
- <a href="https://github.com/praw-dev/praw/blob/master/praw/models/listing/mixins/redditor.py#L35-L185" target="_blank" rel="noopener noreferrer">`praw.praw.models.listing.mixins.redditor.RedditorListingMixin` (35:185)</a>
165+
- <a href="https://github.com/praw-dev/praw/blob/master/praw/models/listing/mixins/subreddit.py#L49-L73" target="_blank" rel="noopener noreferrer">`praw.praw.models.listing.mixins.subreddit.SubredditListingMixin` (49:73)</a>
166+
167+
168+
169+
170+
### [FAQ](https://github.com/CodeBoarding/GeneratedOnBoardings/tree/main?tab=readme-ov-file#faq)
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
```mermaid
2+
graph LR
3+
Pre_Push_Automation["Pre-Push Automation"]
4+
Static_Word_Checks["Static Word Checks"]
5+
Documentation_Checks["Documentation Checks"]
6+
Active_Documentation_Management["Active Documentation Management"]
7+
Version_Management["Version Management"]
8+
Pre_Push_Automation -- "orchestrates" --> Static_Word_Checks
9+
Pre_Push_Automation -- "orchestrates" --> Documentation_Checks
10+
Pre_Push_Automation -- "utilizes" --> Version_Management
11+
```
12+
[![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)
13+
14+
## Component Details
15+
16+
This component comprises scripts and utilities primarily used for the development, testing, and release management of the PRAW library itself. It includes tools for static analysis, unit testing, and version control, and is not part of the library's runtime functionality.
17+
18+
### Pre-Push Automation
19+
This component automates pre-push checks, including running static analysis (pre-commit, sphinx-build) and unit tests (pytest). It orchestrates the execution of these checks and reports their success or failure.
20+
21+
22+
**Related Classes/Methods**:
23+
24+
- <a href="https://github.com/praw-dev/praw/blob/master/pre_push.py#L2-L80" target="_blank" rel="noopener noreferrer">`praw.pre_push` (2:80)</a>
25+
- <a href="https://github.com/praw-dev/praw/blob/master/pre_push.py#L58-L98" target="_blank" rel="noopener noreferrer">`praw.pre_push.main` (58:98)</a>
26+
- <a href="https://github.com/praw-dev/praw/blob/master/pre_push.py#L32-L45" target="_blank" rel="noopener noreferrer">`praw.pre_push.run_static` (32:45)</a>
27+
- <a href="https://github.com/praw-dev/praw/blob/master/pre_push.py#L48-L55" target="_blank" rel="noopener noreferrer">`praw.pre_push.run_unit` (48:55)</a>
28+
- <a href="https://github.com/praw-dev/praw/blob/master/pre_push.py#L10-L29" target="_blank" rel="noopener noreferrer">`praw.pre_push.do_process` (10:29)</a>
29+
30+
31+
### Static Word Checks
32+
This component is responsible for performing static analysis on the codebase, specifically checking for double syntax and 'noreturn' patterns within the code. It uses a dedicated checker class to encapsulate this logic.
33+
34+
35+
**Related Classes/Methods**:
36+
37+
- <a href="https://github.com/praw-dev/praw/blob/master/tools/static_word_checks.py#L5-L100" target="_blank" rel="noopener noreferrer">`praw.tools.static_word_checks` (5:100)</a>
38+
- <a href="https://github.com/praw-dev/praw/blob/master/tools/static_word_checks.py#L120-L140" target="_blank" rel="noopener noreferrer">`praw.tools.static_word_checks.main` (120:140)</a>
39+
- <a href="https://github.com/praw-dev/praw/blob/master/tools/static_word_checks.py#L8-L117" target="_blank" rel="noopener noreferrer">`praw.tools.static_word_checks.StaticChecker` (8:117)</a>
40+
- <a href="https://github.com/praw-dev/praw/blob/master/tools/static_word_checks.py#L75-L117" target="_blank" rel="noopener noreferrer">`praw.tools.static_word_checks.StaticChecker.run_checks` (75:117)</a>
41+
- <a href="https://github.com/praw-dev/praw/blob/master/tools/static_word_checks.py#L27-L55" target="_blank" rel="noopener noreferrer">`praw.tools.static_word_checks.StaticChecker.check_for_double_syntax` (27:55)</a>
42+
- <a href="https://github.com/praw-dev/praw/blob/master/tools/static_word_checks.py#L57-L73" target="_blank" rel="noopener noreferrer">`praw.tools.static_word_checks.StaticChecker.check_for_noreturn` (57:73)</a>
43+
44+
45+
### Documentation Checks
46+
This component focuses on verifying the documentation, particularly by discovering and checking subclasses for proper documentation. It ensures consistency and completeness of the project's documentation.
47+
48+
49+
**Related Classes/Methods**:
50+
51+
- <a href="https://github.com/praw-dev/praw/blob/master/tools/check_documentation.py#L5-L70" target="_blank" rel="noopener noreferrer">`praw.tools.check_documentation` (5:70)</a>
52+
- <a href="https://github.com/praw-dev/praw/blob/master/tools/check_documentation.py#L80-L81" target="_blank" rel="noopener noreferrer">`praw.tools.check_documentation.main` (80:81)</a>
53+
- <a href="https://github.com/praw-dev/praw/blob/master/tools/check_documentation.py#L16-L77" target="_blank" rel="noopener noreferrer">`praw.tools.check_documentation.DocumentationChecker` (16:77)</a>
54+
- <a href="https://github.com/praw-dev/praw/blob/master/tools/check_documentation.py#L46-L77" target="_blank" rel="noopener noreferrer">`praw.tools.check_documentation.DocumentationChecker.check` (46:77)</a>
55+
- <a href="https://github.com/praw-dev/praw/blob/master/tools/check_documentation.py#L36-L43" target="_blank" rel="noopener noreferrer">`praw.tools.check_documentation.DocumentationChecker.discover_subclasses` (36:43)</a>
56+
57+
58+
### Active Documentation Management
59+
This component manages the active documentation versions, primarily by fetching available versions. It likely supports processes related to deploying or updating documentation.
60+
61+
62+
**Related Classes/Methods**:
63+
64+
- <a href="https://github.com/praw-dev/praw/blob/master/tools/set_active_docs.py#L5-L80" target="_blank" rel="noopener noreferrer">`praw.tools.set_active_docs` (5:80)</a>
65+
- <a href="https://github.com/praw-dev/praw/blob/master/tools/set_active_docs.py#L32-L90" target="_blank" rel="noopener noreferrer">`praw.tools.set_active_docs.main` (32:90)</a>
66+
- <a href="https://github.com/praw-dev/praw/blob/master/tools/set_active_docs.py#L14-L29" target="_blank" rel="noopener noreferrer">`praw.tools.set_active_docs.fetch_versions` (14:29)</a>
67+
68+
69+
### Version Management
70+
This component handles the project's versioning, including managing unreleased changes, updating the changelog, incrementing development versions, and updating package version information. It ensures proper version control and release preparation.
71+
72+
73+
**Related Classes/Methods**:
74+
75+
- <a href="https://github.com/praw-dev/praw/blob/master/tools/set_version.py#L5-L100" target="_blank" rel="noopener noreferrer">`praw.tools.set_version` (5:100)</a>
76+
- <a href="https://github.com/praw-dev/praw/blob/master/tools/set_version.py#L64-L70" target="_blank" rel="noopener noreferrer">`praw.tools.set_version.main` (64:70)</a>
77+
- <a href="https://github.com/praw-dev/praw/blob/master/tools/set_version.py#L32-L33" target="_blank" rel="noopener noreferrer">`praw.tools.set_version.handle_unreleased` (32:33)</a>
78+
- <a href="https://github.com/praw-dev/praw/blob/master/tools/set_version.py#L36-L40" target="_blank" rel="noopener noreferrer">`praw.tools.set_version.handle_version` (36:40)</a>
79+
- <a href="https://github.com/praw-dev/praw/blob/master/tools/set_version.py#L15-L29" target="_blank" rel="noopener noreferrer">`praw.tools.set_version.add_unreleased_to_changelog` (15:29)</a>
80+
- <a href="https://github.com/praw-dev/praw/blob/master/tools/set_version.py#L43-L61" target="_blank" rel="noopener noreferrer">`praw.tools.set_version.increment_development_version` (43:61)</a>
81+
- <a href="https://github.com/praw-dev/praw/blob/master/tools/set_version.py#L107-L112" target="_blank" rel="noopener noreferrer">`praw.tools.set_version.valid_version` (107:112)</a>
82+
- <a href="https://github.com/praw-dev/praw/blob/master/tools/set_version.py#L73-L88" target="_blank" rel="noopener noreferrer">`praw.tools.set_version.update_changelog` (73:88)</a>
83+
- <a href="https://github.com/praw-dev/praw/blob/master/tools/set_version.py#L91-L104" target="_blank" rel="noopener noreferrer">`praw.tools.set_version.update_package` (91:104)</a>
84+
85+
86+
87+
88+
### [FAQ](https://github.com/CodeBoarding/GeneratedOnBoardings/tree/main?tab=readme-ov-file#faq)

0 commit comments

Comments
 (0)