Skip to content

Repository files navigation

GoogleDriveApi-DotNet

A C# library that simplifies interaction with the Google Drive API. It doesn't cover the entire API; it wraps the most commonly used endpoints (files, folders, trash, upload/download) behind a clean, fluent interface.

🚧 Pre-release: approaching v1.0.0. Not yet published to NuGet; first preview is in progress. See the Roadmap for status.

Installation

Not yet on NuGet. Clone the repo and reference the project directly:

git clone https://github.com/Illia1F/GoogleDriveApi-DotNet.git
<ProjectReference Include="path/to/src/GoogleDriveApi-DotNet.csproj" />

Coming soon: once the first preview ships, install with: dotnet add package GoogleDriveApi.DotNet --prerelease (dependencies Google.Apis.Drive.v3 and MimeMapping are pulled in transitively).

Quickstart

using GoogleDriveApi_DotNet;
using MimeMapping;

// Authorizes on build (opens a browser the first time).
using GoogleDriveApi gDriveApi = await GoogleDriveApi.CreateBuilder()
    .SetCredentialsPath("credentials.json")
    .SetApplicationName("My Drive App")
    .BuildAsync();

string folderId = await gDriveApi.Folders.CreateAsync("My Folder");
string fileId   = await gDriveApi.Transfers.UploadAsync("photo.jpg", KnownMimeTypes.Jpeg, folderId);
await gDriveApi.Transfers.DownloadAsync(fileId, "Downloads");

You need a Google Cloud project and a credentials.json first; see Getting Started.

Documentation

Guides Reference Project
Getting Started Options Roadmap
Uploading files Exceptions Architecture
Downloading files MIME types Decision records
Managing files Contributing
Folders & hierarchy
Trash
Token & auth

This library is not a full reflection of the real Google Drive API — it implements the most commonly used endpoints to simplify everyday interaction with Google Drive.

Samples

Runnable projects in samples/:

To run a sample, place your credentials.json in samples/Shared. To share more files across samples, add them to the Directory.Build.targets config.

License

MIT. See LICENSE.

Acknowledgements

About

This C# library simplifies interaction with the Google Drive API. While it doesn't cover the entire API, it includes the most commonly used endpoints for easier access to Google Drive.

Topics

Resources

Contributing

Stars

7 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages