Code Monkey home page Code Monkey logo

synolopy's Introduction

Synolopy

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

Version

Current stable version: 0.1.2

Features

Synology NAS (aka DiskStation Manager)
  • [doc.1] Download station API
  • [doc.2] File station API
  • [doc.3] Video station API
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 [email protected]: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/webapi/', '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

Video Station
nas.videostation.programlist.request(<request>)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.