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.0.tar.gz (8.0 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.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tripleuni-0.4.0.tar.gz
  • Upload date:
  • Size: 8.0 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.0.tar.gz
Algorithm Hash digest
SHA256 e98f24b8bd4fbf4e70a227a612cf2aa36a501b15a662eee903adbdfda1bfc9da
MD5 a36b1072745c118ead9446c2473ff494
BLAKE2b-256 1a15c1e459e6bfdd9a5a2b0770073a36d26bb94f25fd13df8adc49ba34cd375d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tripleuni-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 5.7 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4b3588e78ee901617b9a34730fc6b92a0e0a26877a26b900bec8e526afe26456
MD5 f42bb5efc22b482b52d27292928d3d2b
BLAKE2b-256 dc1e66876e410ecf66934b04ec6411e49b1a3e4a4f5704d05322b84762b91584

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