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.2.1.tar.gz
(18.5 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.2.1.tar.gz.
File metadata
- Download URL: gdoc_dumper-0.2.1.tar.gz
- Upload date:
- Size: 18.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a209dcb10e372bd63c9d5ff6d0bb96c9192b86d7244f06e99d3b911046ae1c77
|
|
| MD5 |
4593a0815eb0f4782933f6a63d61db08
|
|
| BLAKE2b-256 |
86bde61d5c15076bf92cd8fbd1f192803a8ec2ed32038d8a2819794d40b0cc43
|
File details
Details for the file gdoc_dumper-0.2.1-py3-none-any.whl.
File metadata
- Download URL: gdoc_dumper-0.2.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 |
782c3d5e25bf16740f5b5ced03d788247d262a9e2c4e133797f4190387fd463e
|
|
| MD5 |
812e30ae0fe48c3466a8e54b0d1fbd91
|
|
| BLAKE2b-256 |
2233c5cef803f9b4917b88fd723fac5222ac00b31ebdeb0a3761cd6feb4d2623
|