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.3.0.tar.gz
(3.8 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.3.0.tar.gz.
File metadata
- Download URL: gdoc_dumper-0.3.0.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f8567f1e56648116dc7fcc1f0bc795e95bf286e3610efa7b9f5d4de528663373
|
|
| MD5 |
8a91c321e210b915edb5e3e78d4952ea
|
|
| BLAKE2b-256 |
3b243bdc6346c4c02d1a3aaf554a987cab9d2b72f62ba08fe1e4836ea0775eea
|
File details
Details for the file gdoc_dumper-0.3.0-py3-none-any.whl.
File metadata
- Download URL: gdoc_dumper-0.3.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.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb92252e46937c914ad1bf1ab4ba2d930a8e96733079c9a0cb588a58846b6235
|
|
| MD5 |
174bb9cf01dc1290bfa87fc025efbaa8
|
|
| BLAKE2b-256 |
46b3cce0ce71470b39995ae7228d36b5daaa91047d1085d3aff3282f55eee8db
|