Skip to main content

googleprint

A simple interface to Google Cloud Print.

Usage:

>>> from googleprint import *
>>> auth = OAuth2(access_token="qwertyuiopasdfghjkl", token_token="Bearer")
>>> r = list_jobs(auth=auth)
>>> r['jobs']
[{"id": ...}, ...]
>>> r = submit_job(printer="0e506d12-dbe0-54d3-7392-fd69d45ff2fc", content="test.pdf", auth=auth)
>>> r['job']
{"id": "abcdefgh", ...}
>>> delete_job("abcdefgh", auth=auth)

Supports both Python 2 and 3:

  • ≥ Python 2.6

  • ≥ Python 3.2

Install

Use pip to install the latest version from PyPI:

pip install googleprint

Command line interface

The module can be used from the command line via:

python -m googleprint ...

See --help for details.

Tests

The test suite requires three environment variables:

  • CP_CLIENT_ID – application “client id” (Google API)

  • CP_CLIENT_SECRET – application “client secret” (Google API)

  • CP_REFRESH_TOKEN – refresh token for an authorised Google Account

  • CP_PRINTER_ID – printer ID (optional, default: __google__docs)

During the tests a PDF is printed. By default the Google Docs printer is used, however it is more forgiving than typical printers, so I don’t recommend using it.

Example:

CP_CLIENT_ID=1234567890.apps.googleusercontent.com \
CP_CLIENT_SECRET=asdfghjklzxcvbnmqwertyuiop \
CP_REFESH_TOKEN=mnbvcxzlkjhgfdspoiuytr \
CP_PRINTER_ID=0e50ed12-dbe0-54d3-a4bd-fdf9d45ff2fc \
tox

Metadata

Release files for googleprint 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for googleprint 0.1.1
File Size Uploaded
googleprint-0.1.1.tar.gz 10.3 kB Details

Release files / googleprint-0.1.1.tar.gz

Download URL googleprint-0.1.1.tar.gz
Size 10.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1da020ef029b0d63151a550df19d0601d8aee93a2719abdc80210e02a2bd6fcb
BLAKE2b-256 checksum
How to use checksums
6010a0a4db10045b9c47442e51482ce9cd855f87efd6c61fa9f7584f8640f9af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

This release

0.1.1 This release

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page