Skip to main content

Synology Python API

Project description

Synology is a Python library aimed to help using Synology device’s APIs.

Version

Current stable version: 0.1.1

Features

Synology NAS (aka DiskStation Manager)

  • [doc.1] Download station API

  • [doc.2] File station API

  • [doc.3] Surveillance station API (work in progress…)

Common Gateway Interface builder

Since Synology APIs are build using the same pattern, this library also uses and provides tools to instanciate a pythonic consumer for any CGI-based API.

Installation

Easy way

pip install synolopy

“Hard” way

git clone git@github.com:thavel/synolopy.git synolopy
cd ./synolopy
pip install .

Disk Station Manager API

Disk Station Manager is the name of the system on any Synology NAS devices.

Quick start

To start using the NAS API, you need to import the library:

from synolopy import NasApi

nas = NasApi('http://192.168.0.99:5000', 'admin', 'my_super_strong_password')

Basically, any API request follows this pattern: > nas.application.service.request(method, [params])

For further information about methods and parameters, you need to read the official documentation of the related application (cf. docs linked above).

Download Station

nas.downloadstation.info.request('getinfo')

>>> {
    'version_string': '3.4-2558',
    'version': 2558,
    'is_manager': True
}

Available services: info, schedule, task, statistic, RSSsite, RSSfeed, btsearch

File Station

nas.filestation.file_share.request('list_share', additional='real_path')

>>> {
    'total': 2,
    'shares': [
        {
            'isdir': True,
            'path': '/public',
            'additional': {
                'real_path': '/volume1/public'
            },
            'name': 'public'
        },
        {
            'isdir': True,
            'path': '/web',
            'additional': {
                'real_path': '/volume1/web'
            },
            'name': 'web'
        }
    ],
    'offset': 0
}

Available services: info, file_share, file_find, file_virtual, file_favorite, file_thumb, file_dirSize, file_md5, file_permission, api_upload, file_download, file_sharing, file_crtfdr, file_rename, file_MVCP, file_delete, file_extract, file_compress, background_task

Download Station

Work in progress…

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

synolopy-0.1.1.tar.gz (3.6 kB view hashes)

Uploaded Source

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