Lightweight python package for downloading Google Docs documents in various formats.
Project description
📄 gdoc-dumper
Lightweight python package for downloading Google Docs documents in various formats
🚀 Installation
Simply install with pip or another package manager:
pip install gdoc-dumper
🔨 Usage
🅰 Async
import asyncio
from gdoc_dumper import Downloader, Formats, FileManager
# Asynchronously download google document as bytes
async def main() -> None:
content: bytes = await Downloader.adownload(url="<GDOC URL>", file_format=Formats.PDF)
# You also can save file after downloading it using FileManager
await FileManager.asave_bytes(content, path="<DESIRED PATH as PATH or String>")
asyncio.run(main())
You also can stream download file and save it
import asyncio
from typing import AsyncGenerator
from gdoc_dumper import Downloader, Formats, FileManager
async def main() -> None:
stream: AsyncGenerator[bytes, None] = Downloader.astream_download(
url="<GDOC URL>",
file_format=Formats.PDF,
)
await FileManager.asave_stream(stream, path="file.pdf")
asyncio.run(main())
🔁 Sync
from gdoc_dumper import Downloader, Formats, FileManager
# Download google document as bytes
content: bytes = Downloader.download(url="<GDOC URL>", file_format=Formats.PDF)
# You also can save file after downloading it using FileManager
path = FileManager.save_bytes(content, path="<DESIRED PATH as PATH or String>")
✅ Available formats
from gdoc_dumper import Formats
print(Formats.TXT.value) # txt
print(Formats.PDF.value) # pdf
print(Formats.DOCX.value) # docx
print(Formats.EPUB.value) # epub
print(Formats.HTML.value) # html
print(Formats.OPEN_DOCUMENT_TEXT.value) # odt
print(Formats.RICH_TEXT.value) # rtf
print(Formats.ZIP.value) # zip
⭐ License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gdoc_dumper-0.1.1.tar.gz
(6.1 kB
view details)
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 gdoc_dumper-0.1.1.tar.gz.
File metadata
- Download URL: gdoc_dumper-0.1.1.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0246ab315116a8c0cec1df252b7131b5a68b5fe07f9f57bbdccb53c00ceae69b
|
|
| MD5 |
686811a0c90e09923f57aedd749a2f5e
|
|
| BLAKE2b-256 |
1d4de50bceef067b7d073a9a9255860301b7e21a9fcb4398d6947e63b05e8e0f
|
File details
Details for the file gdoc_dumper-0.1.1-py3-none-any.whl.
File metadata
- Download URL: gdoc_dumper-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f6ae4b000291f32653445949028632199459fc880340ffc640b174f1edc6f157
|
|
| MD5 |
19ed3a33831c7f161399a4ce53fd39ce
|
|
| BLAKE2b-256 |
2a8b30df556be3630c8fae1954de96a4aad07a66550f92296ff75beb52b690a9
|