Skip to main content

Automated JSON API based communication with Samsung SyncThru Web Service

Project description

PySyncThru - a very basic python SyncThru bridge

Build Status Coverage Status Python Versions

A package that connects to a Samsung printer in the local network that makes use of the SyncThru web service and provides data that is provided via the JSON API of the device. It is able to read the system, toner and tray status and provides method wrappers to access them.

The package supports the following data provided by the printers:

  • Device / System status
  • Drum / Toner status
  • Model name
  • Tray status

Sadly it seems like there is no official API, so fixes are welcome and likely needed!

Usage

import aiohttp
import asyncio
from pysyncthru import SyncThru

async def main():
    async with aiohttp.ClientSession() as session:
        printer = SyncThru(IP_PRINTER, loop, session)
        await printer.update()

        # Is printer online?
        print("Printer online?:", printer.is_online())
        # Show the printer status
        print("Printer status:", printer.device_status())
        if printer.is_online():
            # Show details about the printer
            print("Printer model:", printer.model())
            # Get the details of a cartridge
            print("Toner Cyan details:", printer.toner_status()['cyan'])
            # Get the details about a tray
            print("Tray 1 Capacity:", printer.input_tray_status()[1]['capa'])
        # Print all available details from the printer
        print("All data:\n", printer.raw())

loop = asyncio.get_event_loop()
loop.run_until_complete(method())

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

PySyncThru-0.4.1.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

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

PySyncThru-0.4.1-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file PySyncThru-0.4.1.tar.gz.

File metadata

  • Download URL: PySyncThru-0.4.1.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for PySyncThru-0.4.1.tar.gz
Algorithm Hash digest
SHA256 6df206c4c0a09a5c75a79581d6215cc9a68ef035a9217a8e7e1d22788eb3408f
MD5 207e070d783005b9e99b62217e460481
BLAKE2b-256 54caeec2e9d30cd094f89b8e36c2000f6fbb734e3912d4916d7c70388f533a31

See more details on using hashes here.

File details

Details for the file PySyncThru-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: PySyncThru-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for PySyncThru-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ae195221279e323a366ca8a2373459d1911a5508e5a947bebbc8622527e521ab
MD5 d8a3281514310ccc617ae603afb86d08
BLAKE2b-256 fed2d7612ca489a19c80644c2dbab987a08762f303c92af2eb75f11ff8083c92

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