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.5a0.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for aseafile-0.1.5a0.tar.gz
Algorithm Hash digest
SHA256 afea76820bf0f31fd23d8956e0618acd5b8cf0615a17a5269aed1843a9d9a5b2
MD5 12841dd110be3e4c924620041a7a7893
BLAKE2b-256 659d5ab876209e370313ac30f4e40c289dd29266a0949e5971cec593b2ddf459

See more details on using hashes here.

File details

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

File metadata

  • Download URL: aseafile-0.1.5a0-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.2

File hashes

Hashes for aseafile-0.1.5a0-py3-none-any.whl
Algorithm Hash digest
SHA256 7f248f498c705084dc6279f28c892c2c97368032bd1dba15908bd741003b3416
MD5 d0668b7a40eaa89b893a2343f969151b
BLAKE2b-256 f51ddebf6be61681b4e6eff6ce5157bc13bb4b7ec203f6944eea25730dc479bd

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