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 Package Version 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

IP_PRINTER = '192.168.0.25'

async def main():
    async with aiohttp.ClientSession() as session:
        printer = SyncThru(IP_PRINTER, 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(main())

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.7.4.tar.gz (5.0 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: PySyncThru-0.7.4.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.7

File hashes

Hashes for PySyncThru-0.7.4.tar.gz
Algorithm Hash digest
SHA256 7f2576db75f74a9b55e93864387bd846e44d2262cd06089382534355103100b7
MD5 bfd5c8db1b29f39414b825714997a789
BLAKE2b-256 917bec48c1f1373c7c217303df255aa92a76e554376c461ed66e2a524cef9ef3

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