You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,8 +5,16 @@ All notable changes to this project will be documented here.
5
5
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
6
6
7
7
## [2.4.0]
8
+
### Added
9
+
- Added a `FetchResult` type alias for fetch results that may contain `ChannelData`, `VideoTranscript`, `VideoComments`, or `DLSnippet` objects.
10
+
- Added `--transcripts-only` and `--snippets-only` CLI fetch modes.
11
+
8
12
### Changed
9
13
- Improved developer experience with returning empty list objects on some methods instead of `None`.
14
+
- Changed return types and values for `fetch_transcripts`, `fetch_snippets` and `fetch_comments` to improve type hints.
15
+
- Changed CLI comment flags: `--comments` and `--comments-only` now select the fetch mode, while `--max-comments` controls the number of comments per video.
16
+
- Exporters, `PreviewRenderer`, and `channel_data_to_rows()` now accept any supported fetch result shape and normalize it internally.
If you want a flat, row-based structure for ML workflows (Pandas, HuggingFace datasets, JSON/Parquet), you can use the helper in `ytfetcher.utils` to join transcript segments. Comments are only included if you fetched them with `fetch_with_comments` or `fetch_comments`.
319
+
If you want a flat, row-based structure for ML workflows (Pandas, HuggingFace datasets, JSON/Parquet), you can use the helper in `ytfetcher.utils` to join transcript segments. It accepts any fetch result returned by the public API, including `ChannelData`, `VideoTranscript`, `VideoComments`, and `DLSnippet` lists.
Copy file name to clipboardExpand all lines: docs/exporting.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
# Exporting
2
2
3
-
The exporting feature allows you to save channel data in **multiple formats for analysis, reporting, or integration with other tools.**`ytfetcher` supports three widely-used export formats to suit different use cases and preferences.
3
+
The exporting feature allows you to save fetched data in **multiple formats for analysis, reporting, or integration with other tools.**`ytfetcher` supports three widely-used export formats to suit different use cases and preferences.
4
4
5
-
Use the `BaseExporter` class to export `ChannelData` in **csv, json, or txt**:
5
+
Use the exporter classes to export `ChannelData`or any other supported fetch result in **csv, json, or txt**. Results from `fetch_youtube_data()`, `fetch_with_comments()`, `fetch_transcripts()`, `fetch_snippets()`, and `fetch_comments()` are normalized internally before writing.
6
6
7
7
```py
8
8
from ytfetcher.services import JSONExporter # OR you can import other exporters: TXTExporter, CSVExporter
@@ -56,4 +56,4 @@ class XMLExporter(BaseExporter):
If you want a flat, row-based structure for ML workflows (Pandas, HuggingFace datasets, JSON/Parquet), use the helper in `ytfetcher.utils` to join transcript segments. Comments are only included if you fetched them with `fetch_with_comments` or `fetch_comments`.
262
+
If you want a flat, row-based structure for ML workflows (Pandas, HuggingFace datasets, JSON/Parquet), use the helper in `ytfetcher.utils` to join transcript segments. It accepts any fetch result returned by the public API, including `ChannelData`, `VideoTranscript`, `VideoComments`, and `DLSnippet` lists.
0 commit comments