Skip to main content

Python package to work with Google Documents

Project description

Google Documents

Work with Google Documents simply without any boring stuff regarding Credentials Account etc.

Find the file in 2 lines:

>from google_documents.entities import GoogleDriveFile
>GoogleDriveFile.filter(name="Foo")
[<GoogleDriveFile: FILE_ID - Foo file>]

Read from the Google Sheet just in 3 lines:

>from google_documents.entities import GoogleDriveSpreadsheet
>sh = GoogleDriveSpreadsheet.get(id="YOUR_SPREADSHEET_ID")
>sh.read(range_name="Sheet 1!A1:B4")
[['Your', 'Awesome'], ['Data'], ['.']]
># Or using indexers
>sh["Sheet 1!A1:B4"]
[['Your', 'Awesome'], ['Data'], ['.']]

Export Google Document to word in 3 lines as well:

>from google_documents.entities import GoogleDriveDocument
>doc = GoogleDriveDocument.get(id="YOUR_DOCUMENT_ID")
>doc.export("my_file.docx")

Installation

  1. Install the module via pip:
pip install google-documents
  1. Issue service account file via Google Cloud Console

  2. Put the path to your file in the GOOGLE_DOCUMENT_SERVICE_JSON environment varialbe:

export GOOGLE_DOCUMENT_SERVICE_JSON=PATH_TO_YOUR_SERVICE_ACCOUNT_FILE

That's it. Now you can start using this package

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

google_documents-0.0.7.tar.gz (9.3 kB view details)

Uploaded Source

File details

Details for the file google_documents-0.0.7.tar.gz.

File metadata

  • Download URL: google_documents-0.0.7.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.1

File hashes

Hashes for google_documents-0.0.7.tar.gz
Algorithm Hash digest
SHA256 a6a78d26fb425a543149be51f51630f15343c2b39c2788095b9dc4e643e94400
MD5 9d1aee3d1e271c630b6b813d7a23307c
BLAKE2b-256 d5861d064f801d2aa67bff0072be61ecf2892a710debad65f46b4d82e0117916

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page