Skip to main content

Unofficial library that provides the API methods of the seafile service

Project description

aseafile

Asynchronous seafile

Unofficial library that provides the API methods of the seafile service

Installation

pip install aseafile --upgrade

Features

This library is asynchronous

At the moment, the library has support several sections of the seafile web api:

Currently, only version 2.1 of the seafile web api is supported

Dependencies

python version 3.10 minimum required

Requirements python libraries:

Getting started

Creating an instance of http client and verifying that the service is running using the "ping" method:

import asyncio
from aseafile import SeafileHttpClient


async def main():
    client = SeafileHttpClient(base_url='http://seafile.example.com')

    result = await client.ping()
    print(result.content)  # pong


if __name__ == '__main__':
    asyncio.run(main())

Obtaining access token and sending "auth ping":

import asyncio
from aseafile import SeafileHttpClient


async def main():
    client = SeafileHttpClient(base_url='http://seafile.example.com')

    token_result = await client.obtain_auth_token(username='my@example.com', password='Test123456')

    result = await client.auth_ping(token=token_result.content)
    print(result.content)  # pong


if __name__ == '__main__':
    asyncio.run(main())

Authorization in the service with automatic token saving and sending "auth ping":

import asyncio
from aseafile import SeafileHttpClient


async def main():
    client = SeafileHttpClient(base_url='http://seafile.example.com')

    await client.authorize(username='my@example.com', password='Test123456')

    result = await client.auth_ping()
    print(result.content)  # pong


if __name__ == '__main__':
    asyncio.run(main())

Contributing

free

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

aseafile-0.1.6a0.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

aseafile-0.1.6a0-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

Details for the file aseafile-0.1.6a0.tar.gz.

File metadata

  • Download URL: aseafile-0.1.6a0.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for aseafile-0.1.6a0.tar.gz
Algorithm Hash digest
SHA256 72433726f68e80bbd29d4b45d676be007e13aac134c996fee5e6ead155750d57
MD5 01ff7054ac9edc1dff29125ffd196104
BLAKE2b-256 f3fea2188f275036f86b679d6ff374a5e62352ffe3866e1d403c9e33cd01d7de

See more details on using hashes here.

File details

Details for the file aseafile-0.1.6a0-py3-none-any.whl.

File metadata

  • Download URL: aseafile-0.1.6a0-py3-none-any.whl
  • Upload date:
  • Size: 18.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for aseafile-0.1.6a0-py3-none-any.whl
Algorithm Hash digest
SHA256 c6a991dc73e02773a9d3b1e4ebd32c84a68a017e87ad7ef8d6c59b04b78c0362
MD5 bf5d9b5e5bde2ee92d81c7e4c86626cd
BLAKE2b-256 cfd5a3f56e1fb10ada625e77790868845b3f0baa2fc11004588b4d01b97bb32e

See more details on using hashes here.

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