Package: blaugue
Documentation:Basic usage:fromblaugue.apiimportBlaugueblaugueAPI=Blaugue(email='armand@camponovo.xyz',password='password')search=blaugueAPI.search('query')# search 'query'results=search.results# all resultsforiinresults:print(f'Object{i.__class__.__name__}')# print class name of result iusers=blaugueAPI.all_users()foriinusers:print(i.name)Chat usage:fromblaugue.apiimportBlaugueapi=Blaugue(email='armand@camponovo.xyz',password='password')chats=api.get_chats()# get all chats and return BlaugueChat() listforchatinchats:print(chat.name)# print chat nameformessageinchat.messages:ifchat.id=='blaugue':# all of users are in this chat, message.receiver will return a listprint(message.author.name)print([user.nameforuserinmessage.receiver])# print list of string of usernameselse:print(message.author.name)print(message.receiver.name)print('\n\n')Type variables:If you use an intelligent ide, type your variables to improve coding experiencefromblaugue.userimportBlaugueUserfromblaugue.postimportBlauguePostfromblaugue.tagimportBlaugueTagfromblaugue.apiimportBlauguefromblaugue.chatimportBlaugueChat,BlaugueMessageapi=Blaugue(email='armand@camponovo.xyz',password='password')search=api.search('armand')posts=search.posts_resultspost:BlauguePostusers=search.users_resultsuser:BlaugueUsertags=search.tags_resultstag:BlaugueTagchat:BlaugueChatmessage:BlaugueMessageforpostinposts:print(post.title)fortagintags:print(tag.name)foruserinusers:print(user.name)forchatinapi.get_chats():print(chat.name)formessageinchat.messages:print(message.author.name)Classes:blaugue.api.Blaugue():init:Blaugue(email='you@email.com', password='12345')methods:search(self, query): returnBlaugueResults()of queryget_user(self, email): returnBlaugueUser()of emailget_post(self, post_id): returnBlauguePost()of post idget_lasts_post(self): return list ofBlauguePost()of last ten postsget_chats(self): return list ofBlaugueChat()of all chats (can be accessed by connected user)get_chat(self, chat_id): returnBlaugueChat()object of chatall_users(self): return list ofBlaugueUser()of all usersproperties:None: return Noneblaugue.search.BlaugueResults():init:BlaugueResults(infos, super)methods:None: return Noneproperties:results: return a list ofBlaugueUser()/BlauguePost()/BlaugueTag()objectsjson_results: return a json with resultsusers_results: return a list ofBlaugueUser()objectsposts_results: return a list ofBlauguePost()objectstags_results: return a list ofBlaugueTag()objectsblaugue.user.BlaugueUser():init:BlaugueUser(infos, super)methods:None: return Noneproperties:name: return str of user's nameid: return str of user's idavatar: return str of user's avatar urlpremium: return bool (True if user is premium, False else)premium_icon: return str of user's premium icon urlbot: return bool (True if user is a bot, False else)badges: return list of user's badgesdescription: return str of user's descriptionurl: return str of user's profil urlblaugue.post.BlauguePost():init:BlauguePost(infos, super)methods:None: return Noneproperties:title: return str of post's titlesubtitle: return str of post's subtitlehtml_content: return str of post's html_contentmarkdown_content: return str of post's markdown_contentimage: return str of post's cover image urlbook: return str of post's book urlid: return str of post's idurl: return str of post's urlauthor: returnBlaugueUser()of post's authortype: returnBlaugueTag()of post's tag / typecomments: return list of dict of post's commentsblaugue.tag.BlaugueTag():init:BlaugueTag(infos, super)methods:None: return Noneproperties:name: return str of tag's nameposts: return list ofBlauguePost()of tag's postsurl: return str of tag's urlblaugue.chat.BlaugueChat():init:BlaugueChat(infos, super)methods:None: return Noneproperties:name: return str of chat's nameid: return str of chat's id (can be used to get a chat)messages: return list ofBlaugueMessage()objectsblaugue.chat.BlaugueMessage():init:BlaugueMessage(infos, super, chat)methods:None: return Noneproperties:html_content: return str of message's html content (with < br > and &nbsp ;)content: return str of message's content (without < br > and &nbsp ;)author: returnBlaugueUser()object of message's authorreceiver: returnBlaugueUser()object of message's receiver (list of if chat is the common chat)Get information about connected account:fromblaugue.apiimportBlaugueblaugueAPI=Blaugue(email='armand@camponovo.xyz',password='password')# check if account has been connectedifbool(blaugueAPI):print('Account informations are right !')# get name of connected accountprint(str(blaugueAPI))# get token of connected accountprint(next(blaugueAPI))# get bytes of hash of password of current accountprint(bytes(blaugueAPI))# get BlaugueUser() object of connected accountconnected=blaugueAPI.connectedprint(connected.name)print(connected.avatar)print(connected.premium_icon)