Skip to main content

Python API for communication with Synology DSM

Project description

https://travis-ci.org/ProtoThis/python-synology.svg?branch=master Library version Supported versions Downloads Formated with Black

Installation

[sudo] pip install python-synology

Usage

Constructor:

SynologyDSM(
    dsm_ip,
    dsm_port,
    username,
    password,
    use_https=False,
    debugmode=False,
    dsm_version=6,
)

dsm_version = 5 will use old DSM API to gather volumes and disks informations (from DSM 5.x versions)

Module

You can import the module as synology_dsm.

from synology_dsm import SynologyDSM

print("Creating Valid API")
api = SynologyDSM("<SynologyIp>", "<SynologyPort>", "<Username>", "<Password>")

print("=== Information ===")
print("Model:           " + str(api.information.model))
print("RAM:             " + str(api.information.ram) + " MB")
print("Serial number:   " + str(api.information.serial))
print("Temperature:     " + str(api.information.temperature) + " °C")
print("Temp. warning:   " + str(api.information.temperature_warn))
print("Uptime:          " + str(api.information.uptime))
print("Full DSM version:" + str(api.information.version_string))

print("=== Utilisation ===")
print("CPU Load:        " + str(api.utilisation.cpu_total_load) + " %")
print("Memory Use:      " + str(api.utilisation.memory_real_usage) + " %")
print("Net Up:          " + str(api.utilisation.network_up()))
print("Net Down:        " + str(api.utilisation.network_down()))

print("=== Storage ===")
for volume_id in api.storage.volumes_ids:
    print("ID:          " + str(volume_id))
    print("Status:      " + str(api.storage.volume_status(volume_id)))
    print("% Used:      " + str(api.storage.volume_percentage_used(volume_id)) + " %")

for disk_id in api.storage.disks_ids:
    print("ID:          " + str(disk_id))
    print("Name:        " + str(api.storage.disk_name(disk_id)))
    print("S-Status:    " + str(api.storage.disk_smart_status(disk_id)))
    print("Status:      " + str(api.storage.disk_status(disk_id)))
    print("Temp:        " + str(api.storage.disk_temp(disk_id)))

Credits / Special Thanks

Found Synology API “documentation” on this repo : https://github.com/kwent/syno/tree/master/definitions

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

python-synology-0.5.0.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

python_synology-0.5.0-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file python-synology-0.5.0.tar.gz.

File metadata

  • Download URL: python-synology-0.5.0.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.6

File hashes

Hashes for python-synology-0.5.0.tar.gz
Algorithm Hash digest
SHA256 fe310b5aa2aa11be303dac6d7071f8ed4d71197c5ddd01e1314ce8fd571360e7
MD5 47402478a5ab287943e62dede2bbf2a9
BLAKE2b-256 5dfc490bbfc8be24bfc6879b8ecad4ece1a3ebdc1fe83a5bbae3a0510d04db63

See more details on using hashes here.

Provenance

File details

Details for the file python_synology-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: python_synology-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.6

File hashes

Hashes for python_synology-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 be8babe0da9ff7516a2ab829129d290ad504395fc39a827f645e50a0ca755fc8
MD5 abf9feb2c9e54948ff0edf7ca8a64e34
BLAKE2b-256 5286b3e25b92a70ec3fdcc22b15779e882b2d38e1cf7dea053e9d1c5b4797917

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page