Package: ncellapp
📞Unofficial Python API Wrapper of NcellThis is the unofficial python API wrapper of Ncell App.⚠️ Disclaimer:This project is in no way affiliated with, authorized, maintained, sponsored or endorsed by Ncell or any of its affiliates or subsidiaries. This is an independent and unofficial API. Use at your own risk.InstallationInstall viaPyPipipinstallncellappInstall from the sourcegitclonehttps://github.com/hemantapkh/ncellapp&&cdncellapp&&pythonsetup.pysdist&&pipinstalldist/*Note:You may need to change thepiptopip3orpythontopython3on the above command depending on your system.Start guideQuick Examples1. Getting a Token>>>fromncellappimportregister>>>reg=register('98140*****')>>>reg.generateOtp()<Response[OTP1000]>>>>reg.validateOtp('569845')<Response[OTP1000]>>>>reg.token'eyJt...'2. Viewing the balance>>>fromncellappimportncell>>>account=ncell(token='eyJtc...',autoRefresh=True)>>>balance=account.balance()>>>balance.content{'queryBalanceResponse':{'smsBalanceList':[],'dataBalanceList':[],'creditBalanceDetail':{'expiryDate':'Sep 12 2021 23:59:59','freeSmsCount':10,'tariffPlanRateOffNet':0.0,'balance':4.89793,'unBilledAmount':0.0,'tariffPlanName':'Sajilo','lastLoanTakenDate':'Mar 23 2021 08:22:54','lastRechargeDate':'Apr 27 2021 00:36:58','loanAmount':0.0,'creditUom':'Rs.','tariffPlanRateOnNet':0.0},'msisdn':'98140*****','voiceBalanceList':[],'paidMode':'Prepaid'}}3. Sending a free SMS>>>sms=account.sendFreeSms(980799****,'Hey there!, I am sending you an SMS with Python!')>>>sms.content{'sendFreeSMSResponse':{'description':'Operation succeeded','status':'success','statusCode':'0'}}>>>sms.responseHeader{'responseDesc':'Success','requestId':'1626770987071NCELL968','responseDescDisplay':'SMS1000','responseCode':'200','timestamp':'2021-07-20T14:34:47.12712'}4. Manually refreshing the token and storing the refreshed token (Not recommended)# This function will be executed after refreshing the token>>>defstoreToken(token):...withopen('token','w')asf_in:...f_in.write(token)# Creating an object of ncell which contains 'afterRefresh' and 'args' arguments.# See the documentation for more information.>>>ac=ncellapp.ncell(token=token,afterRefresh=[__name__,'storeToken'],args=['__token__'])# Token expired>>>ac.balance()<Response[LGN2001]># Manually refreshing the token>>>ac.refreshToken()<Response[OTP1000]># Viewing the balance after manually refreshing the token>>>ac.balance()<Response[BAL1000]>5. Refreshing the token automatically and storing the refreshed Token (Recommended)# This function will be executed after refreshing the token.>>>defstoreToken(token):withopen('token','w')asf_in:f_in.write(token)# Creating an object of ncell and setting autoRefresh=True.# See documentation for more information.>>>ac=ncellapp.ncell(token=token,autoRefresh=True,afterRefresh=[__name__,'storeToken'],args=['__token__'])# Token will be refreshed and stored automatically if it expires>>>ac.balace()<Response[BAL1000]>Detailed documentationThe documentation of ncellapp is availablehere.ContributingAny contributions you make aregreatly appreciated.For minor fix, you can directly create a pull request and for adding a new feature, let's first discuss about it.Thanks to everycontributorswho have contributed in this project.LicenseDistributed under the MIT License. SeeLICENSEfor more information.Author/Maintainer: Hemanta Pokharel