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.3.0.tar.gz
(8.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tripleuni-0.3.0.tar.gz.
File metadata
- Download URL: tripleuni-0.3.0.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10f67e0b97b473b9fb84eb3143f296280badb8b23a269e0e1b3d9426b82c0912
|
|
| MD5 |
ce98197cded84fe28ba483df265de44a
|
|
| BLAKE2b-256 |
275d5ddc4f744c7ff736a180f9a81bf445393381192d7313e787c11ed5161f43
|
File details
Details for the file tripleuni-0.3.0-py3-none-any.whl.
File metadata
- Download URL: tripleuni-0.3.0-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8360f98bba57f2e5c7734cb829d0aa430dc5bb5ef3e106befd04fdaea1478764
|
|
| MD5 |
07460f3335f82f83d961cb69ad728453
|
|
| BLAKE2b-256 |
5d110199e6cf5aacf80840137a01340120c7fe7e557d04116e44f09fbc829ba7
|