Skip to main content

synology-api Pepy Total Downloads Website

GitHub last commit GitHub License

Synology Wrapper

If you find yourself here, most probably you are trying to develop something for your NAS, this wrapper might come to your help to build your script.

I would like to specify that I do this for hobby as is my passion and in my little free time.

Said this, there is no warranties chained and this library is provided "As Is", you will find many things can be simplified, and I slowly will but feel free to Contribute.

Premise

I've tried this wrapper only with python3. I do not know if it actually runs with previous versions

Before opening an issue make sure you do your own research, if you are not sure, write me.

Installation

The package is distributed via pip3, but it can also be installed from source.

pip3 install synology-api

or

pip3 install git+https://github.com/N4S4/synology-api

Basic Usage

Here is a basic example on how to use the package, check Getting Started - Basic Usage for more details.

from synology_api.filestation import FileStation
from synology_api.downloadstation import DownloadStation

fs = FileStation(
    'Synology Ip',
    'Synology Port',
    'Username',
    'Password',
    secure=False,
    cert_verify=False,
    dsm_version=7,
    debug=True,
    otp_code=None
)

ds = DownloadStation(
    'Synology Ip',
    'Synology Port',
    'Username',
    'Password',
    secure=False,
    cert_verify=False,
    dsm_version=7,
    debug=True,
    otp_code=None
)

fs_info = fs.get_info()
ds_info = ds.get_info()

For NAS devices reachable through QuickConnect, pass the NAS QuickConnect ID instead of an IP address and port. QuickConnect uses HTTPS automatically.

fs = FileStation(
    quickconnect_id='QuickConnect ID',
    username='Username',
    password='Password',
    cert_verify=False,
    dsm_version=7,
    debug=True,
    otp_code=None
)

Async Client (beta)

Every existing synology-api class can be made async with a single wrapper — no extra dependencies:

import asyncio
from synology_api.filestation import FileStation
from synology_api.async_client import AsyncClient

async def main():
    fs = AsyncClient(FileStation("192.168.1.x", "5001", "admin", "pass",
                                  secure=True, cert_verify=False, dsm_version=7))

    # All methods automatically awaitable
    info = await fs.get_info()
    files = await fs.get_file_list("/home")

    # Run parallel calls
    a, b, c = await asyncio.gather(
        fs.get_file_list("/home"),
        fs.get_file_list("/photo"),
        fs.get_file_list("/music"),
    )

asyncio.run(main())

Check the Async Client documentation for details.

Available Functions

At the moment there are around +300 APIs implemented with countless methods for each, the majority is not documented, but some are.

You can find a exhaustive list here: APIs - Supported APIs

Feeling kind?

If this code helps and you wish to support me:

Community

See Related projects

If you want to show your project in this section, write me.

Bugs

Maybe?

I hate bugs..

Well report them please (if you'll ever use this code)

Conclusions

There is still a lot to implement.

The code is probably in some parts twisted, I will try to optimize it at best.

Contributing

Just Don't Be Scared. Check Contribute - Contribution 101 for useful information.

Author

  • Renato Visaggio - Initial Work - N4S4

Contributors

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

synology_api-0.9.2.tar.gz (279.9 kB view details)

Uploaded Source

Built Distribution

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

synology_api-0.9.2-py3-none-any.whl (276.7 kB view details)

Uploaded Python 3

File details

Details for the file synology_api-0.9.2.tar.gz.

File metadata

  • Download URL: synology_api-0.9.2.tar.gz
  • Upload date:
  • Size: 279.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.0

File hashes

Hashes for synology_api-0.9.2.tar.gz
Algorithm Hash digest
SHA256 a4d1581dbf150a5eb90708165610d6ebc2203b2ed3145e950878e6de89d222f2
MD5 5cd9fcf60ba4c585507ba01346a3976f
BLAKE2b-256 a6b640c2245801785bebe2750e9a855b8118f401bb77c85d6b9c8145978f4218

See more details on using hashes here.

File details

Details for the file synology_api-0.9.2-py3-none-any.whl.

File metadata

  • Download URL: synology_api-0.9.2-py3-none-any.whl
  • Upload date:
  • Size: 276.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.0

File hashes

Hashes for synology_api-0.9.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8901ca9045ac804458794e67270fff8b0556420c16d97f45ff9dc34353210dd1
MD5 353a86e0fc0b547bad6dc8f5c42b7b9e
BLAKE2b-256 86d432747f377f087c60ca266fe6e5fda0f23712f8c04e28852f1f212f461948

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.9.2 This release

2 files

0.9.1

2 files

0.9.0

2 files

0.8.2

2 files

0.8.1

2 files

0.8

2 files

0.7.3

2 files

0.7.2

2 files

0.7.1

2 files

0.7

2 files

0.6.3

2 files

0.6.2

2 files

0.6.1

2 files

0.6

2 files

0.5.2

2 files

0.5.1

2 files

0.5

2 files

0.4.4

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.0

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2

2 files

0.1.3.3

2 files

0.1.3.2

1 file

0.1.3.1

2 files

0.1.3

1 file

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page