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.
Metadata
Release files for quartoogle 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| quartoogle-0.1.4.tar.gz | 118.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| quartoogle-0.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 128.3 kB
Release files / quartoogle-0.1.4.tar.gz
| Download URL | quartoogle-0.1.4.tar.gz |
|---|---|
| Size | 118.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
47459894ab34ab524f1a79bf37a5cbeae72beac57d7672ec0b70c3a6ef9b56cc
|
|
BLAKE2b-256 checksum How to use checksums |
b49eb60ac3558e3cf5bb30d739d659ca11e93f939ab3eed92a55b6024fe8ddaf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|
Release files / quartoogle-0.1.4-py3-none-any.whl
| Download URL | quartoogle-0.1.4-py3-none-any.whl |
|---|---|
| Size | 9.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ee26fe0041c078c03870783f9425c5ac3c142fb627e19b8f03475d2231187cd9
|
|
BLAKE2b-256 checksum How to use checksums |
5966ee00cdf6ad3a04a1d5934f1398f56feea51a691bc8ac249f7cd7f804582b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|