def create_frequency_generator(cls, input_data_store, additional_path): """Read the manifest file from the data store and creates a FrequencyDictGenerator object. :param input_data_store: Data store to read the manifest file from. :param additional_path: Path to the manifest.json file inside the input_data_store. :return: FrequencyDictGenerator object """ manifest_file = load_package_list(input_data_store=input_data_store, additional_path=additional_path) return cls(manifest_file=manifest_file)
def load_package_list_local(cls, input_folder_name, additional_path): """Generate the aggregated manifest list for a given ecosystem from LocalFileSystem datasource. :param input_folder_name: The main directory where the manifest files are stored. :param additional_path: The directory to pick the manifest files from. :return: RecommendationValidator object.""" # Create a LocalFile object input_manifest_data_store = LocalFileSystem(src_dir=input_folder_name) all_list_of_package_set = load_package_list(input_data_store=input_manifest_data_store, additional_path=additional_path) return cls(all_list_of_package_set=all_list_of_package_set)
def load_package_list_s3(cls, input_bucket_name, additional_path): """Generate the aggregated manifest list for a given ecosystem for S3 datasource. :param input_bucket_name: The bucket where the manifest files are stored. :param additional_path: The directory to pick the manifest files from. :return: RecommendationValidator object.""" # Create a S3 object input_manifest_data_store = S3DataStore(src_bucket_name=input_bucket_name, access_key=config.AWS_S3_ACCESS_KEY_ID, secret_key=config.AWS_S3_SECRET_ACCESS_KEY) all_list_of_package_set = load_package_list(input_data_store=input_manifest_data_store, additional_path=additional_path) return cls(all_list_of_package_set=all_list_of_package_set)