Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement channel_info command #3

Open
wants to merge 31 commits into
base: feature/cli
Choose a base branch
from

Conversation

aninhasalesp
Copy link

Add ChannelInfo Command

Overview

This PR introduces the ChannelInfo command, designed to fetch and save YouTube channel information. The command supports multiple input methods (direct URLs/usernames or CSV files) and outputs the data to a CSV file.

Features

  • Command Implementation: ChannelInfo command for retrieving YouTube channel information.
  • Execute method: to manage the entire process of fetching channel information and generating CSV output.
  • Introduced parse_arguments: method for configuring argument parsing and setting execute as the default action.
  • Input Flexibility: Accepts YouTube channel URLs, usernames, or paths to CSV files containing them.
  • Customizable Output: Allows specifying which columns to include in the output CSV file.
  • Helper Methods: Includes a filter_fields method to filter the channel information based on specified columns.

Usage

To use the new ChannelInfo command:

  1. The command was designed to extract the YouTube channel_info associated with a provided URL:
python cli.py --api_key <api_key> channel-info --url <url> 
  1. These are other ways to run the ChannelInfo command:
  • This command allows you to provide multiple URLs and usernames to obtain information on YouTube channels.
python cli.py --api-key <api_key> channel-info --urls <url1> --username <usernames>
  • This command is similar to the previous one but also includes the option to specify an output file to store the results.
python cli.py --api-key <api_key> channel-info --urls <url1> --username <usernames> --output-file-path <output_path> 

- Implemented  method to convert a list of dictionaries into a CSV file or string;
…RLs or a CSV file containing URLs;

- Added commands directory structure
…om URLs, usernames, or CSV files containing them;

- Add  method to filter channel information based on specified columns;
- Define  method to handle the command logic, including reading input, fetching channel data, and saving to CSV;
- Support for various input methods including direct URLs/usernames and file paths for CSV input;
- Support for specifying output CSV file path and columns to include in the output.
fix: show error with parser if not in debug mode
- Changed file path passing to use  from  in the  method;
…and return a string;

- Added logic to convert values retrieved from the CSV file to strings before appending them to the data list;
- Add update channel_info file;
- fix test_base
@aninhasalesp aninhasalesp marked this pull request as ready for review July 4, 2024 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant