Compile quarto docs directly to google drive
Project description
quartoogle
Pronounced "kor-TOO-gul"
Compile your analytical reports directly to google drive. Powered by quarto and the Google Drive API.
Use it from the command line:
quartoogle example.qmd --folder-id "1a2b3c4d5e6f7g8h9i0j"
-----
INFO: Compiling example.qmd to pdf...
INFO: Successfully compiled to: example.pdf
INFO: Authenticating with Google Drive...
INFO: Uploading to Google Drive folder: 1a2b3c4d5e6f7g8h9i0j
INFO: Upload complete!
INFO: View your document at: https://docs.google.com/document/d/DOCUMENT_ID/edit
Or use it programmatically in your Python code:
import quartoogle
file_id, url = quartoogle.publish("example.qmd", folder_id="1a2b3c4d5e6f7g8h9i0j")
print(f"Uploaded to: {url}")
How it works:
- Renders
.qmdfiles to PDF format by default (or any other quarto format via the--tooption) - Uploads directly to the specified folder in your Google Drive (you must manually create the folder and obtain its ID from the URL)
- Automatically adds a timestamp to uploaded filenames (format:
[basename]_YYYY-MM-DD_HH-MM[extension]) to help distinguish between multiple versions - Uses OAuth2 authentication (Secure authentication with token caching)
Set up
- Install quarto from https://quarto.org/docs/get-started/
- Setup google OAuth2 credentials:
- Go to https://console.cloud.google.com/
- Create a project and enable the Google Drive API
- Create OAuth2 credentials (Desktop app type)
- Download as
credentials.jsonto~/.config/google/drive/credentials.json(create directories as needed). Note that if you use a different path, you must specify it in the--credentialsargument when runningquartoogle(see example below).
- Install quartoogle: We're on pypi, so
uv add quartoogle. If working directly on this repo, consider using the simplest-possible virtual environment. - Create a folder in Google Drive where you want to upload your documents, and note its folder ID from the URL (the folder ID is the long alphanumeric string after
/folders/in the URL).
Usage Examples
Basic command-line usage (PDF output by default):
quartoogle report.qmd --folder-id "1a2b3c4d5e6f7g8h9i0j"
Compile to MS Word format, or any other quarto-supported format:
quartoogle report.qmd --folder-id "1a2b3c4d5e6f7g8h9i0j" --to docx
Custom credentials file:
quartoogle report.qmd --folder-id "1a2b3c4d5e6f7g8h9i0j" --credentials path/to/credentials.json
Enable verbose logging (shows all debug messages and quarto output):
quartoogle report.qmd --folder-id "1a2b3c4d5e6f7g8h9i0j" -v
Best practices
Output format:
- PDF is the best choice for most users who need user to be able to comment on the doc in google drive.
- HTML may be superior if view-ability (without commenting) is the main goal.
- Quarto also support MS Word format, but tends to have severe formatting issues even for moderately complex documents.
Development workflow: Do not call quartoogle for every dev iteration on your document. Instead, use tools like
- VSCode extension: Quarto -- enables live execution and preview of .qmd files.
- VSCode extension: vscode-pdf -- enables live preview of .pdf files.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file quartoogle-0.1.3.tar.gz.
File metadata
- Download URL: quartoogle-0.1.3.tar.gz
- Upload date:
- Size: 116.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b673692fc46e2cd781a7405336674ed9aac3fc8052ce4ad86ab9385fa45a0006
|
|
| MD5 |
d46363a70804a38fbf773101e19d83ad
|
|
| BLAKE2b-256 |
3bc990a430843e4a010be07dc623c942d686319ddd1c1d849a160f95e4c7b6a0
|
File details
Details for the file quartoogle-0.1.3-py3-none-any.whl.
File metadata
- Download URL: quartoogle-0.1.3-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86eed0efc95274921ad871cebd95b3e859cf150c20ae2cc98b20fda3d340d24a
|
|
| MD5 |
e5fc5d461ffde6ec86929b06a1258add
|
|
| BLAKE2b-256 |
db946a9ab656758fc5f13edfa18ec7cf902cc61fc47077ce9c8c8572595c25e8
|