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.0.tar.gz
(6.0 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.0.tar.gz.
File metadata
- Download URL: gdoc_dumper-0.1.0.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9776bd2170cbf4a9e52b3a2b6ecc111770667f41e706aca6df6fc3747908ecd
|
|
| MD5 |
4a601d56df5614b689ce2bff4401886c
|
|
| BLAKE2b-256 |
4691151dd657e7cb90e6e483c173d6cd6f31c40895231880f0a4a0b9ba4b0476
|
File details
Details for the file gdoc_dumper-0.1.0-py3-none-any.whl.
File metadata
- Download URL: gdoc_dumper-0.1.0-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 |
959de16b513fb3ae3f7773217d615e51ddfe84273f7696d971761accc3588de3
|
|
| MD5 |
c85bc1379cc53942a8c92aa5a36cbb1f
|
|
| BLAKE2b-256 |
8a82424cd244633a8803eb266b35a7539b8090297fbc20d9dfea8371d421c758
|