google_drive
Version, currently 3.4.215 versions
- 3.4.2latestFeb 15, 2026
- 3.4.1not indexedFeb 15, 2026
- 3.4.0not indexedFeb 15, 2026
- 3.3.0not indexedFeb 15, 2026
- 3.2.2not indexedFeb 15, 2026
- 3.2.1not indexedFeb 15, 2026
- 3.2.0not indexedFeb 15, 2026
- 3.1.4not indexedFeb 15, 2026
- 3.1.3not indexedFeb 15, 2026
- 3.1.2not indexedFeb 15, 2026
- 3.1.1not indexedFeb 15, 2026
- 3.1.0not indexedFeb 15, 2026
- 3.0.2not indexedFeb 15, 2026
- 3.0.1not indexedFeb 15, 2026
- 3.0.0not indexedFeb 15, 2026
github.com/cyangle/google_drive
Google Drive V3 API Client Generated by OpenAPI Generator
11 stars
0 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
google_drive:
github: cyangle/google_drive
version: ~> 3.4.2Then run:
shards installshard.yml
- Crystal
>= 1.4, < 2- License
- MIT
- Author
- cyangle
Dependencies
Runtime Dependencies
- crest~> 1.3.7github: mamantoha/crest
Development Dependencies
- ameba*github: crystal-ameba/amebadev
- kemal~> 1.0github: kemalcr/kemaldev
- webmock~> 0.14.0github: manastech/webmock.crdev
- post_process~> 0.2.2github: cyangle/post_processdev
README
# google_drive
The Crystal module for the Drive API
Manages files in Drive including uploading, downloading, searching, detecting changes, and updating sharing permissions.
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project with CUSTOM templates:
- API version: v3
- Package version: 3.4.2
- Build package: org.openapitools.codegen.languages.CrystalClientCodegen
- Custom templates: [crystal_client_generator](https://github.com/cyangle/crystal_client_generator)
For more information, please visit [https://google.com](https://google.com)
## Installation
### Install from Git
Add the following to shard.yaml
```yaml
dependencies:
google_drive:
github: cyangle/google_drive
version: ~> 3.4.2
```
## Usage
Check [here](https://developers.google.com/drive/api/v3/reference) for more information about how to use google drive v3 APIs.
Below lists only a few examples of the most interesting APIs, the client should support all APIs provided by google drive as it's generated from the OpenAPI v3 specification `./google-drive-api-v3-oas3.json`.
### Require this shard in your project
First you need to require it.
```crystal
require "google_drive"
```
Or require a specific api only.
```crystal
require "google_drive/api/files_api"
```
### Configure client with google OAuth2 access token
```crystal
GoogleDrive.configure do |config|
config.access_token = "Google OAuth2 Access Token"
end
```
### FilesApi
```crystal
files_api = GoogleDrive::FilesApi.new
```
#### List files
```crystal
files_api.list(page_size: 10, spaces: "appDataFolder")
```
#### Get file meta data by id
```crystal
file_meta : GoogleDrive::File = files_api.get(file_id: "unique_file_id")
```
#### Download file by id
```crystal
files_api.get(file_id: "unique_file_id", alt: "media") do |response|
File.open("my_file.txt", "w") do |file|
IO.copy(response.body_io, file)
end
end
```
#### Upload file
##### Simple upload
```crystal
new_file_meta : GoogleDrive::File = files_api.upload(
upload_type: "media",
media: File.open("./test.json")
)
```
##### Multipart upload
```crystal
file_meta = GoogleDrive::File.new(
name: "test.json",
mime_type: "application/json",
parents: ["appDataFolder"]
)
new_file_meta : GoogleDrive::File = files_api.upload(
upload_type: "multipart",
metadata: IO::Memory.new(file_meta.to_json),
media: File.open("./test.json")
)
```
#### Create folder
```crystal
folder = GoogleDrive::File.new(
name: "my_app",
mime_type: "application/vnd.google-apps.folder",
parents: ["appDataFolder"]
)
files_api.create(file: folder)
```
#### Update file metadata by id
Update file name.
```crystal
file_meta = GoogleDrive::File.new(name: "new_name.json")
files_api.update(file_id: "unique_file_id", file: file_meta)
```
#### Update file content by id
```crystal
files_api.update_content(file_id: "unique_file_id", media: File.open("./test2.json"))
```
#### Delete file by id
```crystal
files_api.delete(file_id: "unique_file_id")
```
## Development
Install dependencies
```shell
shards
```
Run the tests:
```shell
crystal spec
```
Run lints
```shell
./bin/ameba
crystal tool format --check
```
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
3.4.2- Tagged
- Feb 15, 2026
- Commit
2273d05531ff- Crystal
>= 1.4, < 2- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/cyangle/google_drive
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 14, 2026
- Synced
- Aug 13, 2026
- Versions
- 15