Package: mesibo
mesibo Python Packagemesibo offers everything to make your app real-time and scalable. It's modular, lightweight, and easy to integrate.mesibo supports almost all popular platforms and languages for you to quickly build your applications. Whether you are developing mobile apps (Android, iOS, Java, Objective-C, C++), web apps (Javascript), integrating with backend (Linux, macOS, Windows, Python, C++), or creating cool devices using Raspberry Pi, mesibo has APIs for you.mesibo's high-performance Python library enables you to interface your chat clients with various scientific computing and machine learning systems on your backend like TensorFlow, Matlab, Octave, NumPy, etc to create a powerful chat experience and analysis.Website:https://mesibo.comDocumentation:https://mesibo.com/documentation/Tutorials:https://mesibo.com/documentation/tutorials/get-startedSupported PlatformsMesibo Python Package supports the following platforms.RedHat 7.x or above (also, Rocky Linux, CentOS)Debian / UbuntuMac OS - both x86_64 and arm64 (M1) versionsMicrosoft Windows 10 and above (64-bit)Raspberry Pi 3 and 4 (64-bit)Note that, Mesibo is no longer supporting or offering 32-bit versions.ExampleBelow are some examples of typical usage. For more examples, see theexamplesdirectory on the GitHub repo.Sending and Receiving Messages#!/usr/bin/python3importmesibofrommesiboimportMesiboListenerclassPyMesiboListener(MesiboListener):defMesibo_onConnectionStatus(self,status):"""A status = mesibo.MESIBO_STATUS_ONLINE means the listenersuccessfully connected to the mesibo server"""print("## Mesibo_onConnectionStatus: ",status)return0defMesibo_onMessage(self,msg):"""Invoked on receiving a new messageor reading database messagesmsg: Message Object"""try:if(msg.isRichMessage()):print("\n## message:",msg.message)print("\n## title:",msg.title)print("\n## subtitle:",msg.subtitle)print("\n## path:",msg.file.path)print("\n## url:",msg.file.url)#print("\n ## tn:", msg.file.thumbnail)else:print("\n## Received data:",msg.data)except:passprint("\n## Mesibo_onMessage: ",msg)return0defMesibo_onMessageUpdate(self,msg):"""Invoked on receiving a message update"""print("\n## Mesibo_onMessageUpdate: ",msg)return0defMesibo_onMessageStatus(self,msg):"""Invoked when the statusof an outgoing or sent message is changed."""print("## Mesibo_onMessageStatus",msg)return0defMesibo_onPresence(self,msg):print("## Mesibo_onPresence",msg)return0# Get access token and app id by creating a mesibo user# See https://mesibo.com/documentation/tutorials/get-started/ACCESS_TOKEN="<use your user token>"APP_ID="com.mesibo.python"# Create a Mesibo Instanceapi=mesibo.getInstance()# if you are sending or receiving binary/signalling data, set the format. By default, mesibo# auto detects and sets to Unicode string or bytes[]# You can override it by setting mesibo.MESIBO_READAS_BYTES or mesibo.MESIBO_READAS_UNICODE# mesibo.readDataAs(mesibo.MESIBO_READAS_AUTO)#input("Press Enter to continuee...\n")# Enable or disable End-to-end-encryption#e2ee = api.e2ee();#e2ee.enable(1)# Set Listenerlistener=PyMesiboListener()api.addListener(listener)# Set your AUTH_TOKEN obtained while creating the userif(-1==api.setAccessToken(ACCESS_TOKEN)):print("===> Invalid ACCESS_TOKEN: ",ACCESS_TOKEN)print("See https://mesibo.com/documentation/tutorials/get-started/")exit(1)# Set APP_ID which you used to create AUTH_TOKENapi.setAppName(APP_ID)# Set the name of the databaseapi.setDatabase("mesibo",0)# Start mesibo,api.start()msg=api.newMessage("destination")#msg.title = "some title";msg.message="First Message";#msg.data = "raw data"#msg.data = bytearray(b'Hello')#msg.data = bytes([0x68, 0x65]);input("Press Enter to send a message...\n")#msg.setContent("https://www.netflix.com/in/title/81312835?s=i&trkid=13747225&vlang=en&clip=81641466&t=wha")msg.send()#e2ee.getPublicCertificate("/root/pycert.cert")#print("fingerPrint: " + e2ee.getFingerprint("destination"))#Wait for the application to exitapi.wait()Installing using pipSeerequirementsto learn about installation requirements before you continue.$ sudo python -m pip install mesiboInstalling from sourceAlternatively, you can build and install the package by downloading the source code from the GitHub repo.Download the source files frommesibo Python repo on GitHubgit clone https://github.com/mesibo/python.gitYou will find the following directory structure:|-- examples 
|-- setup.py
|-- srcTo build the mesibo Python package from sourcesudo python setup.py buildTo build and install the mesibo Python package from sourcesudo python setup.py installTutorialWrite your First mesibo Enabled Application - PythonTroubleshootingIf you are facing issues installing the package, execute the following to print verbose logs.$ sudo python -m pip install mesibo -vThen, raise an issueherewith the complete logs.If you get a run-time error likeUnable to load: ... Platform not supported ...then mesibo does not support this platform. Contact us athttps://mesibo.com/support/with your platform details, python version, installation logs, etc and we will help you out.