Package: lpulive
LpuLiveInteract LpuLive programmatically using a simple Python Library.
Allows you to search, conversation lookup, messages lookup, profile view etc.ContentsGetting StartedMethods/FunctionsGet ConversationGet MessagesGet ThreadsGet MembersUser SearchLogoutGetting StartedInstall this package from pypi$ pip install lpulive
$ python
>>> from lpulive import User
>>>MethodsSee all MethodsGet ConversationsTo get all the active chatfunction takes no argumentfunction return adictionaryobjectchats: list of all the chat active on users profileid: id of particular chatchat_name: name of the chatdate_time: last acitve message on that chatunread: total unread messages on that chattotal_chat: total group/private chat active on users profilesUsagefromlpuliveimportUserregno=<RegistrationNumber>password=<Password>user=User(registration_no=regno,password=password)conversation_data=user.get_conversations()print(conversation_data)Get MessagesTo get all the messages of selected chatfunctions takes to argument chat_id, msg_threadchat_id: to select a particular chat to get all messages [ required argument ]msg_thread: to turn on thread, this will also include the threads of messages ( if applicable ) [ default value isFalse]function return adictionaryobjectchat_id: id of the chatmessages: list of all the messages in that chatid: id number ( smaller the id newer the message )m_id: message idmessage: text messagefrom_user: message sender nameregno: message sender registration numberattachment: any attachment in that message ( if applicable )thread_message: get all the thread of a particular message ( ifmsg_threadisTrue)chat_name: name of the chattotal_messages: total messages in that chatuser_name: name of current userUsage Without threads activefromlpuliveimportUserregno=<RegistrationNumber>password=<Password>user=User(registration_no=regno,password=password)chat_id=<chatidtosearch>messages_data=user.get_messages(chat_id=chat_id)print(messages_data)Usage With threads activeWith threads active fetched messages will also have thread messageswith active thread, data fetching may be little slowmessages_data=user.get_messages(chat_id=chat_id,msg_thread=True)print(messages_data)Get Message ThreadsTo get the thread of particular messagefunction takes to parameterchat_id,msg_idchat_id: chat_id of the chatmsg_id: message id for which thread is to be extractedFunction returns adictionaryobject of thread message of that messagechat_id: chat_id of the chatmsg_id: message id of the chatmessages: messages of all the threadtotal_thread: count of total messages in threadUsagefromlpuliveimportUserregno=<RegistrationNumber>password=<Password>user=User(registration_no=regno,password=password)chat_id=<chat_idtosearch>msg_id=<m_idofamessagetoseethethread>threads_data=user.get_message_threads(chat_id=chat_id,msg_id=msg_id)print(threads_data)Get MembersTo get all the members list in a particular channelfunction takes one argumentchat_idchat_id: chat_id of the chatfunction returns adictionaryobjectchat_id: chat_id of the chatmembers: list of membersname: name of the memberregno: registration numberprofile_img: profile image of the memberphone: phone number ( if available )total_members: count fof total membersUsagefromlpuliveimportUserregno=<RegistrationNumber>password=<Password>user=User(registration_no=regno,password=password)chat_id=<chatidtosearch>members_data=user.get_chat_members(chat_id=chat_id)print(members_data)User SearchTo search userfunction takes one argumentqueryquery: search queryfunction returns adictionaryobjectsearch_query: search queryusers: list of users foundid: idname: name of the userregno: registration number of the userdepartment: department/batch of the userprofile_img: profile image of the usertotal_found: total user matched the queryUsagefromlpuliveimportUserregno=<RegistrationNumber>password=<Password>user=User(registration_no=regno,password=password)query=<searchquery>search_data=user.search_users(query=query)print(search_data)LogoutLogout the user from local sessionClears up all the local cachefunction takes no argumentfunction return astringobjectUsagefromlpuliveimportUserregno=<RegistrationNumber>password=<Password>user=User(registration_no=regno,password=password)logout_output=user.logout()print(logout_output)Made with 💜 in India