pub async fn competitions_data_download_file(
        &self,
        id: impl AsRef<str>,
        file_name: impl AsRef<str>,
        target: Option<PathBuf>,
    ) -> anyhow::Result<PathBuf> {
        let file_name = file_name.as_ref();
        let output = target.unwrap_or_else(|| self.download_dir.join(format!("{}.zip", file_name)));

        Ok(Self::download_file(
            self.client.get(self.join_url(format!(
                "competitions/data/download/{}/{}",
                id.as_ref(),
                file_name
            ))?),
            output,
        )
        .await?)
    }
/// Download a competition data file to a designated location, or to
/// download location.
/// Returns the location of the zip file download.
///
/// Errors
///
/// This will fail if the authorized user has not yet accepted the
/// competition's rules.
///
/// Example
///
/// Download file `train.csv` from competition
/// `3d-object-detection-for-autonomous-vehicles` as zipfile to
/// `<download-dir>/train.csv.zip`
///
/// ```no_run
/// use kaggle::KaggleApiClient;
///
/// #[tokio::main]
/// async fn main() -> Result<(), Box<dyn std::error::Error>> {
///     let kaggle = KaggleApiClient::builder().build()?;
///     let resp = kaggle
///         .competitions_data_download_file(
///             "3d-object-detection-for-autonomous-vehicles",
///             "train.csv",
///             None,
///         )
///         .await?;
///     Ok(())
/// }
/// ```
Download a competition data file to a designated location, or to
download location.
Returns the location of the zip file download.

Errors

This will fail if the authorized user has not yet accepted the
competition's rules.

Example




Download a competition data file to a designated location or to download location . Returns the location of the zip file download . Errors This will fail if the authorized user has not yet accepted the competition ' s rules . Example
pub async fn competitions_data_download_file(
        &self,
        id: impl AsRef<str>,
        file_name: impl AsRef<str>,
        target: Option<PathBuf>,
    ) -> anyhow::Result<PathBuf> {
        let file_name = file_name.as_ref();
        let output = target.unwrap_or_else(|| self.download_dir.join(format!("{}.zip", file_name)));
        Ok(Self::download_file(
            self.client.get(self.join_url(format!(
                "competitions/data/download/{}/{}",
                id.as_ref(),
                file_name
            ))?),
            output,
        )
        .await?)
    }
pub async fn competitions_data_download_file ( & self , id : impl AsRef < str > , file_name : impl AsRef < str > , target : Option < PathBuf > , ) -> anyhow :: Result < PathBuf > { let file_name = file_name . as_ref ( ) ; let output = target . unwrap_or_else ( | | self . download_dir . join ( format ! ( " " file_name ) ) ) ; Ok ( Self :: download_file ( self . client . get ( self . join_url ( format ! ( " " id as_ref ( ) file_name ) ) ? ) , output , ) . await ? ) }
Download a competition data file to a designated location, or to
download location.
Download a competition data file to a designated location or to download location .
&self
id
impl AsRef<str>
file_name
impl AsRef<str>
target
Option<PathBuf>
&self
id
impl AsRef<str>
file_name
impl AsRef<str>
target
Option<PathBuf>
[tokio::main]
async fn main() -> Result<(), Box> {
let kaggle = KaggleApiClient::builder().build()?;
let resp = kaggle
.competitions_data_download_file(
"3d-object-detection-for-autonomous-vehicles",
"train.csv",
None,
)
.await?;
Ok(())
}
```
async fn main () - > Result< () Box > { let kaggle = KaggleApiClient :: builder () . build () ? ; let resp = kaggle . competitions_data_download_file ( " 3d - object - detection - for - autonomous - vehicles " " train . csv " None ) . await? ; Ok (( )) } ` ` `