Skip to main content

Python client of Resman

Project description

ResMan Client

Introduction

This is the client of Resman Server.

Use pip install resman-client to install it.

Initialize

from resman_client import ResmanClient

client = ResmanClient(
    "https://resman.xxx.com/",
    "user-name",
    "password"
)

Image List

from resman_client import ImageList, DefaultS3Image, ImageListClient

image_list: ImageListClient = client.create_image_list(
    ImageList(
        title="title",
        description="content",
        data={
            # jsonable object
        }
    )
)

image_list.append_s3_images([
    # DefaultS3Image objects
    # Can be different bucket, but must be same server as Resman Server
])

image_list.upload_images([
    # filenames, binary data or binary IOs
])

Video List

from resman_client import VideoListClient, VideoList

video_list: VideoListClient = client.create_video_list(
    VideoList(
        title="title",
        description="whatever",
        data={
            # jsonable object 
        }
    )
)

# Upload video
video_list.upload_mp4_video(
    "mp4 file path"
)

Novel

from resman_client import NovelClient, Novel

novel: NovelClient = client.create_novel(
    Novel(
        title="title",
        data={
            # jsonable object 
        }
    ),
    text="Content of the novel"
)

Some Notice

  • Support mp4 (h264/h265) video only
  • data is a JSON body to store some metadata like original URL, won't be displayed in website
  • Video and Image list have an attribute order to control the order, auto increasing (+1) will be applied while uploading multi objects, the order of objects with same order field can't be predicted.

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

resman-client-1.9.tar.gz (23.5 kB view details)

Uploaded Source

Built Distribution

resman_client-1.9-py3-none-any.whl (21.0 kB view details)

Uploaded Python 3

File details

Details for the file resman-client-1.9.tar.gz.

File metadata

  • Download URL: resman-client-1.9.tar.gz
  • Upload date:
  • Size: 23.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for resman-client-1.9.tar.gz
Algorithm Hash digest
SHA256 7e9d6495204bcf4f93492d006701b61896817422e9adc8c645759416841b94c5
MD5 114e107c842289cd4a9f73bdee5b74d5
BLAKE2b-256 276080b22e76f8e020ee0cb78510ba20151be827e3ec1c25cad367cb11d90b1b

See more details on using hashes here.

File details

Details for the file resman_client-1.9-py3-none-any.whl.

File metadata

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

File hashes

Hashes for resman_client-1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 15f52c92fabc236587efa70b9637d6b3531a8d28c3b5894f0a39f9c3edb2188c
MD5 d3fa5c4f1dcb00344431ead0a2402c5d
BLAKE2b-256 4cea6df9dd565ee985e710ccbd46d4721de1ea877fb4bd5f479ca9f7db0faf7a

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