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.2.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

resman_client-1.2-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: resman-client-1.2.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.1

File hashes

Hashes for resman-client-1.2.tar.gz
Algorithm Hash digest
SHA256 0c510f849e4f51c132b21c76d5844b3541a72f150725c75a0ebfc63f02bab5ec
MD5 85c6b9ba3f84016afbf728dfa6f76592
BLAKE2b-256 e071821ed9e855b866a6d59cf72405c8e78c4a5451541ffb5e6808625971be33

See more details on using hashes here.

File details

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

File metadata

  • Download URL: resman_client-1.2-py3-none-any.whl
  • Upload date:
  • Size: 16.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.1

File hashes

Hashes for resman_client-1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2b71cfab5d6674a898693ffc89c10ddc0cbb96acd300e854e15076bd3797f5fc
MD5 3e297a04ad2bc9fd158453f0f4a5922b
BLAKE2b-256 7f8bd9b9f9c963aeb04e7a503eaa02a2bde3bbd14b5b72ba885fdd453a48801d

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