Skip to main content

python library for tripleuni

Project description

tripleuni

A python library for tripleuni.

Installation

pip install tripleuni

Usage

Login

you need to login to use the library

login in terminal

from tripleuni import TripleClient
client = TripleClient()
client.sendVerification("your email address")
client.verifyCode("your verification code")

login by token

from tripleuni import TripleClient
client = TripleClient("your token")

list of methods

### login
def sendVerification(self, email: str) -> dict:
def verifyCode(self, code: str) -> dict:

### get post and comment
def getPostList(self, page: int = 0) -> dict:
def getDetail(self, uni_post_id: int) -> dict:

### post operations
def followPost(self, uni_post_id: int) -> dict:
def reportPost(self, uni_post_id: int, comment_order: int, comment_msg: str, report_msg: str) -> dict:

### comment and reply
def commentMsg(self, uniPostId: int, msg: str, real_name: str = 'false') -> dict:
def replyMsg(self, uni_post_id: int, comment_father_id: int, msg: str, real_name: str = 'false') -> dict:

### chat
def createChatSession(self, uni_post_id: int, real_name: str = 'false') -> dict:
def sendChatMsg(self, chat_id: int, msg: str) -> dict:
def sendChatMsgToPost(self, uni_post_id: int, msg: str, real_name: str = 'false') -> dict:

### chat with bot
#### return a string of chat messages
def chatWithChatbot(self, msg: str, history: str = '[]') -> str:
#### return a iterator of chat messages
def streamWithChatbot(self, msg: str, history: str = '[]') -> iterator:

Some examples

# get post list
postList = client.getPostList(page=1)

# comment a post
client.commentMsg(1234, "hello", real_name='false')

# send chat message to post owner
client.sendChatMsgToPost(1234, "hello", real_name='false')

For Maintainers

Build

py -m pip install --upgrade build
py -m build
py -m pip install --upgrade twine
twine upload dist/*

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

tripleuni-0.4.2.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

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

tripleuni-0.4.2-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file tripleuni-0.4.2.tar.gz.

File metadata

  • Download URL: tripleuni-0.4.2.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for tripleuni-0.4.2.tar.gz
Algorithm Hash digest
SHA256 654e7ed15e3f4a7e397eda545350054c562333aabfb1172e3028b6cb46e0b8d4
MD5 0319ba314ed3d1d6b5250ecbda1bbfe7
BLAKE2b-256 ab705d9d15fdac16306e010a35b96e091d212aa78f897bc2c936c2c3bcfcd9f2

See more details on using hashes here.

File details

Details for the file tripleuni-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: tripleuni-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for tripleuni-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 80a7bca4188bd5624196a070c7b034d27e512f62973554afb6fa52e3e71a7f10
MD5 da524cb176b4d0c831d62ce2eb3db738
BLAKE2b-256 f46b2d6cc4d07862c8b74d261754594869f5f3bb4ec9ccaba964feeb0d5b7d11

See more details on using hashes here.

Supported by

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