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_id command #2

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

Conversation

aninhasalesp
Copy link

@aninhasalesp aninhasalesp commented Jun 25, 2024

Add command to extract youtube channel IDs from URLs and generate CSV

Overview

This PR introduces the ChannelId command, which extracts YouTube channel IDs from URLs or from a CSV file containing URLs and generates a CSV file with the channel IDs. Additionally, it refactors the CLI tool to use a command-based structure, with a base Command class to standardize command implementation.

Features

  • Command Implementation: ChannelId command to handle the extraction of youtube channel IDs.
  • Command execution: Enhanced execute method to handle the end-to-end process of fetching channel IDs and generating the output CSV.
  • Command Base Class: Implemented Command as a foundational class for defining CLI commands.
  • Default Execution Method: Introduced parse_arguments method to configure argument parsing and set execute method as the default action for each command.
  • Extendable Execution Logic: Included an abstract execute method, to be overridden by subclasses, for executing command-specific logic.

Usage

To use the new ChannelId command:

  1. From a list of URLs:

    python cli.py --api_key <api_key> channel-id --urls <url1> <url2> --output-file-path <output_path>
  2. These are other ways to run the ChannelId command:

  • The command was designed to extract the YouTube channel ID associated with a provided URL.
   python cli.py --api-key <api_key> channel-id --urls <url1>
  • The command is used to perform automated extraction of YouTube channel IDs from URLs contained in a CSV file.
   python cli.py --api-key <api_key> channel-id --urls-file-path <input_csv_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
@aninhasalesp aninhasalesp changed the base branch from develop to feature/cli June 25, 2024 15:03
@aninhasalesp aninhasalesp marked this pull request as ready for review July 2, 2024 14:06
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