Skip to main content

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/*

Release files for tripleuni 0.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tripleuni 0.4.2
File Size Uploaded
tripleuni-0.4.2.tar.gz 8.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tripleuni 0.4.2
File Interpreter ABI Platform
tripleuni-0.4.2-py3-none-any.whl Python 3 none any Details

Total release size: 14.5 kB

Release files / tripleuni-0.4.2.tar.gz

Download URL tripleuni-0.4.2.tar.gz
Size 8.4 kB
Tags Source
SHA-256 checksum
How to use checksums
654e7ed15e3f4a7e397eda545350054c562333aabfb1172e3028b6cb46e0b8d4
BLAKE2b-256 checksum
How to use checksums
ab705d9d15fdac16306e010a35b96e091d212aa78f897bc2c936c2c3bcfcd9f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Release files / tripleuni-0.4.2-py3-none-any.whl

Download URL tripleuni-0.4.2-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
80a7bca4188bd5624196a070c7b034d27e512f62973554afb6fa52e3e71a7f10
BLAKE2b-256 checksum
How to use checksums
f46b2d6cc4d07862c8b74d261754594869f5f3bb4ec9ccaba964feeb0d5b7d11
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.4.2 This release

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page