def download_kaggle_data(self, competition_or_dataset: str) -> ReadWritePath: """Download data for a given Kaggle Dataset or competition. Note: This function requires the Kaggle CLI tool. Read the installation guide at https://www.kaggle.com/docs/api. Args: competition_or_dataset: Dataset name (`zillow/zecon`) or competition name (`titanic`) Returns: The path to the downloaded files. """ return kaggle.download_kaggle_data( competition_or_dataset, self._download_dir)
def test_competition_download_404(self): with testing.mock_kaggle_api(err_msg='404 - Not found'): with testing.tmp_dir() as tmp_dir: with self.assertRaisesRegex( ValueError, 'Please ensure you have spelled the name'): kaggle.download_kaggle_data('digit-recognize', tmp_dir)