Send To Kindle
Project description
stkclient implements a client for amazon’s “Send to Kindle” service. It allows python programs to send files to a kindle device without the 10mb limit that applies to email files.
Features
OAuth-based authorization
Send large (>10MB) files to Kindle devices
Requirements
TODO
Installation
You can install Send To Kindle via pip from PyPI:
$ pip install stkclient
Creating a Client
To create a client, you must authenticate the user. Currently the only supported authentication mechanism is OAuth2:
import stkclient
a = stkclient.OAuth2()
signin_url = a.get_signin_url()
# Open `signin_url` in a browser, sign in and authorize the application, pass
# the final redirect_url below
client = a.create_client(redirect_url)
Once a client is created, it can be serialized and deserialized using Client.load / Client.loads and client.dump / client.dumps
with open('client.json', 'w') as f:
client.dump(f)
with open('client.json', 'r') as f:
client = stkclient.Client.load(f)
Sending a File
Once you have a Client object, you can list devices and send files to specified devices.
devices = client.get_owned_devices()
destinations = [d.device_serial_number for d in devices.owned_devices]
client.send_file(filepath, destinations, author=author, title=title)
License
Distributed under the terms of the MIT license, Send To Kindle is free and open source software.
Credits
Project structure from @cjolowicz’s Hypermodern Python Cookiecutter template.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for stkclient-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4a54268080771f56114fd226f37d981e50c4a9ccedff46afa2bed5015b8f221 |
|
MD5 | 796e94e23395b5d04ba9c57042f84703 |
|
BLAKE2b-256 | 9ab11b6c27c5e971379601adb02e5aa57f6544c011142c008473ca86ce3d21db |