GithubHelp home page GithubHelp logo

cloudprinting's Introduction

cloudprinting

A simple interface to Google Cloud Print.

Usage:

>>> from cloudprinting 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 cloudprinting

Command line interface

The module can be used from the command line via:

python -m cloudprinting ...

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

Change log

0.3.2

  • Fix bug in auto-refreshing of OAuth2
  • Remove expiration time recording from OAuth2

0.3.1

  • Make OAuth2 arguments all optional
  • Fix MANIFEST.in
  • Fix README bugs

0.3.0

  • Add OAuth2 authentication
  • ClientLoginAuth only available on Python 2.x
  • By default send capabilities (even if it's [{}]). This fixes some issues
  • Print jobs now default to using the filename as the title (no more automatic inclusion of datetime)
  • Added a crude command line interface

0.2.0

  • Make ClientLoginAuth cache authentication token

0.1.0

  • Initial version

cloudprinting's People

Contributors

aeikenberry avatar bradleyayers avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cloudprinting's Issues

a

Description:

a

Description:

f

TypeScript Version:

1.7.5 / 1.8.0-beta / nightly (1.9.0-dev.20160217)

Code

// A self-contained demonstration of the problem follows...

Expected behavior:

Actual behavior:

a

Description:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.