<filename>proto_builder/core/config.py
import json
import click

from proto_builder.core.file_utils import file_exists


class Config(object):

    def __init__(self, github_repository_owner: str, github_repository_name: str, package_name: str):
        """
        Creates the Config object from the parameters passed.
        :param github_repository_owner: Owner of the GitHub repository.
        :param github_repository_name: Name of the GitHub repository.
        :param package_name: Name of the package.
        """
        self.github_repository_name = github_repository_name
        self.github_repository_owner = github_repository_owner
        self.package_name = package_name


def load_config(config_file: str) -> Config:
    """
    Loads the configuration from file and parse it to a Config object.
    :param config_file: The path and name of the configuration file.
    :return: A Config object loaded from the config.json file on the proto folder
    """
    click.secho("Loading configuration file...", fg='green')
    if not file_exists(config_file):
        raise FileNotFoundError(
            "config.json file does not exist on the folder with .protos. Create file before continuing.")

    with open(config_file, "r") as f_in:
        json_dict = json.load(f_in)
        return Config(**json_dict)

<filename>proto_builder/core/config.py
import json
import click

from proto_builder.core.file_utils import file_exists


class Config(object):

    def __init__(self, github_repository_owner: str, github_repository_name: str, package_name: str):
        """
        Creates the Config object from the parameters passed.
        :param github_repository_owner: Owner of the GitHub repository.
        :param github_repository_name: Name of the GitHub repository.
        :param package_name: Name of the package.
        """
        self.github_repository_name = github_repository_name
        self.github_repository_owner = github_repository_owner
        self.package_name = package_name


def load_config(config_file: str) -> Config:
    """
    Loads the configuration from file and parse it to a Config object.
    :param config_file: The path and name of the configuration file.
    :return: A Config object loaded from the config.json file on the proto folder
    """
    click.secho("Loading configuration file...", fg='green')
    if not file_exists(config_file):
        raise FileNotFoundError(
            "config.json file does not exist on the folder with .protos. Create file before continuing.")

    with open(config_file, "r") as f_in:
        json_dict = json.load(f_in)
        return Config(**json_dict)

Creates the Config object from the parameters passed.         :param github_repository_owner: Owner of the GitHub repository.         :param github_repository_name: Name of the GitHub repository.         :param package_name: Name of the package. Loads the configuration from file and parse it to a Config object.     :param config_file: The path and name of the configuration file.     :return: A Config object loaded from the config.json file on the proto folder