Skip to main content

Send To Kindle

Project description

PyPI Status Python Version License

Read the documentation at https://stkclient.readthedocs.io/ Tests Codecov

pre-commit Black

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stkclient-0.1.0.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stkclient-0.1.0-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file stkclient-0.1.0.tar.gz.

File metadata

  • Download URL: stkclient-0.1.0.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.8.12 Darwin/21.2.0

File hashes

Hashes for stkclient-0.1.0.tar.gz
Algorithm Hash digest
SHA256 036d135b7e8adf3ba083d10792238ff3fabdcbe20410e23db20c9441edd26e9e
MD5 fe53530bace910bb7974b55db9dd456a
BLAKE2b-256 a322a065f98b786a45e75ffbc8bd28fe0ad38f808cbd1bd9baa9c14973c4ebed

See more details on using hashes here.

File details

Details for the file stkclient-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: stkclient-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.8.12 Darwin/21.2.0

File hashes

Hashes for stkclient-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4bdad841c21b0873c023d4675ea794795791c5124e231810f245242214924c7f
MD5 05f3fd43e18264164733938e97bfb465
BLAKE2b-256 c747050900f22a71ca1fcf36174427d0367cb8ecea5428fccd492f55dccbef7f

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